tests: test that narrow preserves bookmarks on widen
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 06 Dec 2018 10:15:41 -0800
changeset 40884 21e7c73af75f
parent 40883 4edd427f34c1
child 40885 0d50bfcd8f65
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	Fri Dec 07 14:23:17 2018 -0800
+++ b/tests/test-narrow.t	Thu Dec 06 10:15:41 2018 -0800
@@ -237,6 +237,21 @@
   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