tests: test that narrow preserves bookmarks on widen
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 06 Dec 2018 10:15:41 -0800
changeset 53631 21e7c73af75f895b29a375c4d62b5f7a1e655cba
parent 53630 4edd427f34c14523647ef19fe9ba2bd8d939e87f
child 53632 0d50bfcd8f65f336aa21397cf58cc1d711b6ac2d
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
tests: test that narrow preserves bookmarks on widen When widening inserts older commits in the changelog, we have to preserve bookmarks so they are not removed by the call to repair.strip() we temporarily do. We didn't have any tests for that before. Differential Revision: https://phab.mercurial-scm.org/D5396
tests/test-narrow.t
--- a/tests/test-narrow.t
+++ b/tests/test-narrow.t
@@ -232,16 +232,31 @@ Narrowing doesn't resurrect old commits 
   $ hg tracked --removeinclude d3 --force-delete-local-changes -q
   $ hg log -T "{rev}: {desc}\n"
   3: add d10/f
   2: add d3/f
   1: add d2/f
   0: add d0/f
   $ cd ..
 
+Widening doesn't lose bookmarks
+  $ hg clone --narrow ssh://user@dummy/master widen-bookmarks --include d0 -q
+  $ cd widen-bookmarks
+  $ hg bookmark my-bookmark
+  $ hg log -T "{rev}: {desc} {bookmarks}\n"
+  1: add d10/f my-bookmark
+  0: add d0/f 
+  $ hg tracked --addinclude d3 -q
+  $ hg log -T "{rev}: {desc} {bookmarks}\n"
+  3: add d10/f my-bookmark
+  2: add d3/f 
+  1: add d2/f 
+  0: add d0/f 
+  $ cd ..
+
 Can remove last include, making repo empty
   $ hg clone --narrow ssh://user@dummy/master narrow-empty --include d0 -r 5
   adding changesets
   adding manifests
   adding file changes
   added 2 changesets with 1 changes to 1 files
   new changesets *:* (glob)
   updating to branch default