mercurial/commands.py
changeset 42124 d6437f414437
parent 42109 2a3c0106ded9
child 42129 232a33a11ce0
--- a/mercurial/commands.py	Fri Apr 05 15:57:09 2019 +0300
+++ b/mercurial/commands.py	Fri Apr 05 16:05:20 2019 +0300
@@ -1125,11 +1125,11 @@
             ui.status(_('marked working directory as branch %s\n') % label)
 
             # find any open named branches aside from default
-            others = [n for n, h, t, c in repo.branchmap().iterbranches()
-                      if n != "default" and not c]
-            if not others:
-                ui.status(_('(branches are permanent and global, '
-                            'did you want a bookmark?)\n'))
+            for n, h, t, c in repo.branchmap().iterbranches():
+                if n != "default" and not c:
+                    return 0
+            ui.status(_('(branches are permanent and global, '
+                        'did you want a bookmark?)\n'))
 
 @command('branches',
     [('a', 'active', False,