changeset 7256:df800e004077

bookmarks: Avoid unconditional forwarding of bookmarks for the null revision This patch fixes the following minor problem: % hg bookmark -r null test % hg bookmarks test -1:000000000000 [...] % hg commit % hg bookmarks * test 17:861ce7a241f9 That is: Bookmarks referring to the null revision are always forwarded to the current revision.
author Joel Rosdahl <joel@rosdahl.net>
date Sat, 25 Oct 2008 19:05:52 +0200
parents 69e431ea124d
children 7fb0e130cf14
files hgext/bookmarks.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/bookmarks.py	Sat Oct 25 19:05:52 2008 +0200
+++ b/hgext/bookmarks.py	Sat Oct 25 19:05:52 2008 +0200
@@ -19,7 +19,7 @@
 from mercurial.commands import templateopts, hex, short
 from mercurial.i18n import _
 from mercurial import cmdutil, util, commands, changelog
-from mercurial.node import nullrev
+from mercurial.node import nullid, nullrev
 from mercurial.repo import RepoError
 import mercurial, mercurial.localrepo, mercurial.repair, os
 
@@ -182,6 +182,8 @@
             move the bookmark"""
             node  = super(bookmark_repo, self).commit(*k, **kw)
             parents = repo.changelog.parents(node)
+            if parents[1] == nullid:
+                parents = (parents[0],)
             marks = parse(repo)
             update = False
             for mark, n in marks.items():