##// END OF EJS Templates
bookmarks: use changectx instead of remembering hex of hidden revision...
Yuya Nishihara -
r43998:fe2e0d10 default
parent child Browse files
Show More
@@ -953,16 +953,13 b' def addbookmarks(repo, tr, names, rev=No'
953 cur = repo[b'.'].node()
953 cur = repo[b'.'].node()
954 newact = None
954 newact = None
955 changes = []
955 changes = []
956 hiddenrev = None
957
956
958 tgt = cur
959 # unhide revs if any
957 # unhide revs if any
960 if rev:
958 if rev:
961 repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn')
959 repo = scmutil.unhidehashlikerevs(repo, [rev], b'nowarn')
962 ctx = scmutil.revsingle(repo, rev)
960
963 if ctx.hidden():
961 ctx = scmutil.revsingle(repo, rev)
964 hiddenrev = ctx.hex()[:12]
962 tgt = ctx.node()
965 tgt = ctx.node()
966
963
967 for mark in names:
964 for mark in names:
968 mark = checkformat(repo, mark)
965 mark = checkformat(repo, mark)
@@ -979,11 +976,11 b' def addbookmarks(repo, tr, names, rev=No'
979 if not changes:
976 if not changes:
980 return
977 return
981
978
982 if hiddenrev:
979 if ctx.hidden():
983 repo.ui.warn(_(b"bookmarking hidden changeset %s\n") % hiddenrev)
980 repo.ui.warn(_(b"bookmarking hidden changeset %s\n") % ctx.hex()[:12])
984
981
985 if ctx.obsolete():
982 if ctx.obsolete():
986 msg = obsutil._getfilteredreason(repo, b"%s" % hiddenrev, ctx)
983 msg = obsutil._getfilteredreason(repo, ctx.hex()[:12], ctx)
987 repo.ui.warn(b"(%s)\n" % msg)
984 repo.ui.warn(b"(%s)\n" % msg)
988
985
989 marks.applychanges(repo, tr, changes)
986 marks.applychanges(repo, tr, changes)
General Comments 0
You need to be logged in to leave comments. Login now