diff hgext/bookmarks.py @ 7316:9737041646bc

bookmarks: Use dirstate to determine the current node in addchangegroup Using the changectx might result in a lookup error during the strip command. Thefore we use the current dirstate to get the parents of the working directory.
author David Soria Parra <dsp@php.net>
date Wed, 05 Nov 2008 03:53:34 +0100
parents b19c0200c90b
children 4c3e0ad58c5b
line wrap: on
line diff
--- a/hgext/bookmarks.py	Mon Nov 03 16:01:24 2008 -0600
+++ b/hgext/bookmarks.py	Wed Nov 05 03:53:34 2008 +0100
@@ -200,10 +200,7 @@
             return node
 
         def addchangegroup(self, source, srctype, url, emptyok=False):
-            try:
-                onode = repo.changectx('.').node()
-            except RepoError, inst:
-                pass
+            parents = repo.dirstate.parents()
 
             result = super(bookmark_repo, self).addchangegroup(
                 source, srctype, url, emptyok)
@@ -214,7 +211,7 @@
             marks = parse(repo)
             update = False
             for mark, n in marks.items():
-                if n == onode:
+                if n in parents:
                     marks[mark] = node
                     update = True
             if update: