diff tests/test-bookmarks.t @ 19523:f37b5a17e6a0 stable 2.7

bookmarks: pull --update updates to active bookmark if it moved (issue4007) This makes `hg pull --update` behave the same wrt the active bookmark as `hg pull && hg update` does as of 2096e025a728. A helper function, bookmarks.calculateupdate, is added to prevent code duplication between postincoming and update.
author Kevin Bullock <kbullock@ringworld.org>
date Thu, 01 Aug 2013 21:43:14 -0500
parents 5b1835485442
children aa9385f983fa
line wrap: on
line diff
--- a/tests/test-bookmarks.t	Thu Aug 01 20:06:00 2013 -0500
+++ b/tests/test-bookmarks.t	Thu Aug 01 21:43:14 2013 -0500
@@ -507,19 +507,37 @@
    * Z                         3:125c9a1d6df6
      x  y                      2:db815d6d32e6
 
+pull --update works the same as pull && update
+
+  $ hg bookmark -r3 Y
+  moving bookmark 'Y' forward from db815d6d32e6
+  $ hg -R cloned-bookmarks-update update Y
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R cloned-bookmarks-update pull --update .
+  pulling from .
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files (+1 heads)
+  updating bookmark Y
+  updating bookmark Z
+  updating to active bookmark Y
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
 test wrongly formated bookmark
 
   $ echo '' >> .hg/bookmarks
   $ hg bookmarks
      X2                        1:925d80f479bb
-     Y                         2:db815d6d32e6
+     Y                         3:125c9a1d6df6
    * Z                         3:125c9a1d6df6
      x  y                      2:db815d6d32e6
   $ echo "Ican'thasformatedlines" >> .hg/bookmarks
   $ hg bookmarks
   malformed line in .hg/bookmarks: "Ican'thasformatedlines"
      X2                        1:925d80f479bb
-     Y                         2:db815d6d32e6
+     Y                         3:125c9a1d6df6
    * Z                         3:125c9a1d6df6
      x  y                      2:db815d6d32e6