diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -1341,9 +1341,21 @@ if hiddentype == 'warn': unfi = repo.unfiltered() - revstr = ", ".join([pycompat.bytestr(unfi[l]) for l in revs]) + + revstr = [] + obsfatemsgs = [] + + for revision in revs: + ctx = unfi[revision] + revstring = pycompat.bytestr(ctx) + revstr.append(revstring) + obsfatemsgs.append(obsutil._getfilteredreason(repo, revstring, ctx)) + repo.ui.warn(_("warning: accessing hidden changesets for write " - "operation: %s\n") % revstr) + "operation: %s\n") % ", ".join(revstr)) + + for obsfatemsg in obsfatemsgs: + repo.ui.warn(obsfatemsg + "\n") # we have to use new filtername to separate branch/tags cache until we can # disbale these cache when revisions are dynamically pinned. diff --git a/tests/test-directaccess.t b/tests/test-directaccess.t --- a/tests/test-directaccess.t +++ b/tests/test-directaccess.t @@ -270,14 +270,18 @@ $ hg writedirectaccess -r 28ad74 warning: accessing hidden changesets for write operation: 28ad74487de9 + hidden revision '28ad74487de9' was rewritten as: d716de383093 RANGE [2] $ hg writedirectaccess -r 2443a0 warning: accessing hidden changesets for write operation: 2443a0e66469 + hidden revision '2443a0e66469' was rewritten as: d716de383093 RANGE [3] $ hg writedirectaccess -r "28ad74:2443a0" warning: accessing hidden changesets for write operation: 28ad74487de9, 2443a0e66469 + hidden revision '28ad74487de9' was rewritten as: d716de383093 + hidden revision '2443a0e66469' was rewritten as: d716de383093 RANGE [2, 3] $ hg writedirectaccess -r "28ad74 + 2443a0" @@ -287,6 +291,7 @@ $ hg writedirectaccess -r "28ad74:d716de" warning: accessing hidden changesets for write operation: 28ad74487de9 + hidden revision '28ad74487de9' was rewritten as: d716de383093 RANGE [2, 3, 4] Setting a bookmark will make that changeset unhidden, so this should come in end