diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -1306,7 +1306,7 @@ """ return sink -def unhidehashlikerevs(repo, specs, hiddentype): +def unhidehashlikerevs(repo, specs, hiddentype, warnmessage=None): """parse the user specs and unhide changesets whose hash or revision number is passed. @@ -1342,8 +1342,12 @@ if hiddentype == 'warn': unfi = repo.unfiltered() revstr = ", ".join([pycompat.bytestr(unfi[l]) for l in revs]) - repo.ui.warn(_("warning: accessing hidden changesets for write " - "operation: %s\n") % revstr) + if warnmessage is None: + repo.ui.warn(_("warning: accessing hidden changesets for write " + "operation: %s\n") % revstr) + else: + warnmessage += " %s\n" + repo.ui.warn(_(warnmessage) % revstr) # we have to use new filtername to separate branch/tags cache until we can # disbale these cache when revisions are dynamically pinned.