identify: when using -T, avoid unnecessary remote bookmarks query
authorValentin Gatien-Baron <vgatien-baron@janestreet.com>
Mon, 01 Oct 2018 14:44:27 -0400
changeset 39991 a91398dc73ab
parent 39990 c9026e9297e3
child 39992 77492c10a35b
identify: when using -T, avoid unnecessary remote bookmarks query Differential Revision: https://phab.mercurial-scm.org/D4839
mercurial/commands.py
--- 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')