diff mercurial/localrepo.py @ 17550:fc530080013b

bookmarks: extract valid destination logic in a dedicated function We usually update bookmarks only if the new location is descendant of the old bookmarks location. We extract this logic into a function. This is the first step to allow more complex logic using obsolescence in this validation of the bookmark movement.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Sun, 26 Aug 2012 00:28:56 +0200
parents 31f32a96e1e3
children bf2eb3a126d2
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sun Aug 26 00:27:44 2012 +0200
+++ b/mercurial/localrepo.py	Sun Aug 26 00:28:56 2012 +0200
@@ -1992,7 +1992,7 @@
                 if nr in self:
                     cr = self[nr]
                     cl = self[nl]
-                    if cl in cr.descendants():
+                    if bookmarks.validdest(self, cr, cl):
                         r = remote.pushkey('bookmarks', k, nr, nl)
                         if r:
                             self.ui.status(_("updating bookmark %s\n") % k)