##// END OF EJS Templates
bookmarks: add bookmarks to hidden revs if directaccess config is set...
Pulkit Goyal -
r35629:7336ac5e default
parent child Browse files
Show More
@@ -830,6 +830,7 b' def addbookmarks(repo, tr, names, rev=No'
830 cur = repo.changectx('.').node()
830 cur = repo.changectx('.').node()
831 newact = None
831 newact = None
832 changes = []
832 changes = []
833 hiddenrevs = set()
833 for mark in names:
834 for mark in names:
834 mark = checkformat(repo, mark)
835 mark = checkformat(repo, mark)
835 if newact is None:
836 if newact is None:
@@ -839,10 +840,17 b' def addbookmarks(repo, tr, names, rev=No'
839 return
840 return
840 tgt = cur
841 tgt = cur
841 if rev:
842 if rev:
842 tgt = scmutil.revsingle(repo, rev).node()
843 repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
844 ctx = scmutil.revsingle(repo, rev)
845 if ctx.hidden():
846 hiddenrevs.add(ctx.hex()[:12])
847 tgt = ctx.node()
843 for bm in marks.checkconflict(mark, force, tgt):
848 for bm in marks.checkconflict(mark, force, tgt):
844 changes.append((bm, None))
849 changes.append((bm, None))
845 changes.append((mark, tgt))
850 changes.append((mark, tgt))
851 if hiddenrevs:
852 repo.ui.warn(_("bookmarking hidden changeset %s\n") %
853 ', '.join(hiddenrevs))
846 marks.applychanges(repo, tr, changes)
854 marks.applychanges(repo, tr, changes)
847 if not inactive and cur == marks[newact] and not rev:
855 if not inactive and cur == marks[newact] and not rev:
848 activate(repo, newact)
856 activate(repo, newact)
@@ -186,3 +186,11 b' Commands with undefined cmdtype should n'
186 abort: hidden revision '2' was rewritten as: 2443a0e66469!
186 abort: hidden revision '2' was rewritten as: 2443a0e66469!
187 (use --hidden to access hidden revisions)
187 (use --hidden to access hidden revisions)
188 [255]
188 [255]
189
190 Setting a bookmark will make that changeset unhidden, so this should come in end
191
192 $ hg bookmarks -r 28ad74 book
193 bookmarking hidden changeset 28ad74487de9
194
195 $ hg bookmarks
196 book 2:28ad74487de9
@@ -1851,6 +1851,7 b' test that second parent prevent a change'
1851 bookmarks prevent a changeset being hidden
1851 bookmarks prevent a changeset being hidden
1852
1852
1853 $ hg bookmark --hidden -r 1 X
1853 $ hg bookmark --hidden -r 1 X
1854 bookmarking hidden changeset a765632148dc
1854 $ hg log --template '{rev}:{node}\n'
1855 $ hg log --template '{rev}:{node}\n'
1855 1:a765632148dc55d38c35c4f247c618701886cb2f
1856 1:a765632148dc55d38c35c4f247c618701886cb2f
1856 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1857 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
@@ -1859,6 +1860,7 b' bookmarks prevent a changeset being hidd'
1859 divergent bookmarks are not hidden
1860 divergent bookmarks are not hidden
1860
1861
1861 $ hg bookmark --hidden -r 1 X@foo
1862 $ hg bookmark --hidden -r 1 X@foo
1863 bookmarking hidden changeset a765632148dc
1862 $ hg log --template '{rev}:{node}\n'
1864 $ hg log --template '{rev}:{node}\n'
1863 1:a765632148dc55d38c35c4f247c618701886cb2f
1865 1:a765632148dc55d38c35c4f247c618701886cb2f
1864 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1866 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
@@ -1333,6 +1333,7 b' bookmarks change'
1333 $ echo "hello" > b
1333 $ echo "hello" > b
1334 $ hg commit --amend -m "message"
1334 $ hg commit --amend -m "message"
1335 $ hg book bookb -r 13bedc178fce --hidden
1335 $ hg book bookb -r 13bedc178fce --hidden
1336 bookmarking hidden changeset 13bedc178fce
1336 $ hg log -r 13bedc178fce
1337 $ hg log -r 13bedc178fce
1337 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753]
1338 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753]
1338 $ hg book -d bookb
1339 $ hg book -d bookb
@@ -1496,6 +1496,7 b' equivalents in destination'
1496 $ hg log -r . # working dir is at rev 3 (successor of 2)
1496 $ hg log -r . # working dir is at rev 3 (successor of 2)
1497 3:be1832deae9a b (no-eol)
1497 3:be1832deae9a b (no-eol)
1498 $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now
1498 $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now
1499 bookmarking hidden changeset 1e9a3c00cbe9
1499 $ hg up 2 && hg log -r . # working dir is at rev 2 again
1500 $ hg up 2 && hg log -r . # working dir is at rev 2 again
1500 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1501 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1501 2:1e9a3c00cbe9 b (rewritten using rebase as 3:be1832deae9a) (no-eol)
1502 2:1e9a3c00cbe9 b (rewritten using rebase as 3:be1832deae9a) (no-eol)
General Comments 0
You need to be logged in to leave comments. Login now