Commits

Pierre-Yves David committed d3c1fe0

prune: handle bookmark

  • Participants
  • Parent commits a2938a5

Comments (0)

Files changed (2)

File hgext/evolve.py

         if newnode.node() != wdp.node():
             commands.update(ui, repo, newnode.rev())
             ui.status(_('working directory now at %s\n') % newnode)
+        # upVdate bookmarks
+        for ctx in repo.unfiltered().set('bookmark() and %ld', precs):
+            ldest = list(repo.set('max((::%d) - obsolete())', ctx))
+            if ldest:
+                dest = ldest[0]
+                updatebookmarks = _bookmarksupdater(repo, ctx.node())
+                updatebookmarks(dest.node())
+            else:
+                # delete bookmarks
+                pass
     finally:
         lockmod.release(lock, wlock)
 

File tests/test-prune.t

   $ cat >> $HGRCPATH <<EOF
   > [ui]
-  > logtemplate={rev}:{node|short}[] ({obsolete}/{phase}) {desc|firstline}\n
+  > logtemplate={rev}:{node|short}[{bookmarks}] ({obsolete}/{phase}) {desc|firstline}\n
   > [extensions]
   > hgext.rebase=
   > EOF
   $ mkcommit c
   $ mkcommit d
   $ mkcommit e
+  $ hg bookmarks BABAR
   $ hg log -G
-  @  4:9d206ffc875e[] (stable/draft) add e
+  @  4:9d206ffc875e[BABAR] (stable/draft) add e
   |
   o  3:47d2a3944de8[] (stable/draft) add d
   |
   | |
   | o  5:814c38b95e72[] (stable/draft) add bb
   |/
-  o  0:1f0dee641bb7[] (stable/public) add a
+  o  0:1f0dee641bb7[BABAR] (stable/public) add a
   
 
 one old, one new
   | |
   | o  5:814c38b95e72[] (stable/draft) add bb
   |/
-  o  0:1f0dee641bb7[] (stable/public) add a
+  o  0:1f0dee641bb7[BABAR] (stable/public) add a
   
 
 one old, two new
   | |
   | o  5:814c38b95e72[] (stable/draft) add bb
   |/
-  o  0:1f0dee641bb7[] (stable/public) add a
+  o  0:1f0dee641bb7[BABAR] (stable/public) add a
   
 
 two old, two new (should be denied)