# HG changeset patch # User Joel Rosdahl # Date 2008-10-25 17:05:52 # Node ID df800e0040775ef7171501d837351c60c9c13ea8 # Parent 69e431ea124d274d21d5b3cd4b80a48ce1b62d3b 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. diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py --- a/hgext/bookmarks.py +++ b/hgext/bookmarks.py @@ -19,7 +19,7 @@ merge, hg update). 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 @@ def reposetup(ui, repo): 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():