identify: when using -T, avoid unnecessary remote bookmarks query
Differential Revision: https://phab.mercurial-scm.org/D4839
--- a/mercurial/commands.py Mon Oct 01 09:58:42 2018 -0400
+++ b/mercurial/commands.py Mon Oct 01 14:44:27 2018 -0400
@@ -3034,17 +3034,18 @@
return sorted(bms)
- if bookmarks:
- output.extend(getbms())
- elif default and not ui.quiet:
- # multiple bookmarks for a single parent separated by '/'
- bm = '/'.join(getbms())
- if bm:
- output.append(bm)
-
- fm.data(node=hex(remoterev))
- if 'bookmarks' in fm.datahint():
- fm.data(bookmarks=fm.formatlist(getbms(), name='bookmark'))
+ if fm.isplain():
+ if bookmarks:
+ output.extend(getbms())
+ elif default and not ui.quiet:
+ # multiple bookmarks for a single parent separated by '/'
+ bm = '/'.join(getbms())
+ if bm:
+ output.append(bm)
+ else:
+ fm.data(node=hex(remoterev))
+ if 'bookmarks' in fm.datahint():
+ fm.data(bookmarks=fm.formatlist(getbms(), name='bookmark'))
else:
if rev:
repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')