Patchwork [3,of,4] tag: do not pass binary nullid to scmutil.revsingle()

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 4, 2015, 3:10 p.m.
Message ID <2fe6baa83605980bf2a5.1438701029@mimosa>
Download mbox | patch
Permalink /patch/10102/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 4, 2015, 3:10 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1426398326 -32400
#      Sun Mar 15 14:45:26 2015 +0900
# Node ID 2fe6baa83605980bf2a57b1b0b7a5177b884c0f5
# Parent  fb330f1901e39f450b5aec93e590df1a247c2bfc
tag: do not pass binary nullid to scmutil.revsingle()

Future patches will remove the old-style parser that happen to accept a
binary nodeid. A binary nodeid shouldn't be passed to scmutil.revrange()
because it is ambiguous. For example, bin('20' * 19 + '30') is valid binary
nodeid, but it can also be parsed as a revset expression, '0'.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6248,7 +6248,7 @@  def tag(ui, repo, name1, *names, **opts)
                         raise util.Abort(_("tag '%s' is not a global tag") % n)
                     else:
                         raise util.Abort(_("tag '%s' is not a local tag") % n)
-            rev_ = nullid
+            rev_ = 'null'
             if not message:
                 # we don't translate commit messages
                 message = 'Removed tag %s' % ', '.join(names)