D4839: identify: when using -T, avoid unnecessary remote bookmarks query

valentin.gatienbaron (Valentin Gatien-Baron) phabricator at mercurial-scm.org
Tue Oct 2 16:19:35 UTC 2018


valentin.gatienbaron created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4839

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3024,17 +3024,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')



To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list