Add "null" pseudo-tag pointing to nullid
authorBrendan Cully <brendan@kublai.com>
Tue, 05 Dec 2006 13:41:42 -0800
changeset 3801 bd7011246fab
parent 3794 630caaf29815
child 3802 a0d0d24c4e71
Add "null" pseudo-tag pointing to nullid
mercurial/commands.py
mercurial/localrepo.py
--- a/mercurial/commands.py	Tue Dec 05 16:33:40 2006 +0100
+++ b/mercurial/commands.py	Tue Dec 05 13:41:42 2006 -0800
@@ -2189,7 +2189,7 @@
     necessary.  The file '.hg/localtags' is used for local tags (not
     shared among repositories).
     """
-    if name in ['tip', '.']:
+    if name in ['tip', '.', 'null']:
         raise util.Abort(_("the name '%s' is reserved") % name)
     if rev_ is not None:
         ui.warn(_("use of 'hg tag NAME [REV]' is deprecated, "
--- a/mercurial/localrepo.py	Tue Dec 05 16:33:40 2006 +0100
+++ b/mercurial/localrepo.py	Tue Dec 05 13:41:42 2006 -0800
@@ -376,6 +376,8 @@
             key = self.dirstate.parents()[0]
             if key == nullid:
                 raise repo.RepoError(_("no revision checked out"))
+        elif key == 'null':
+            return nullid
         n = self.changelog._match(key)
         if n:
             return n