D1073: commands: move a bunch of statements into if True for next patch

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sat Oct 14 14:41:36 UTC 2017


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

REVISION SUMMARY
  This patch moves a bunch of statements under if True to reduce the noise for the
  next patch.

REPOSITORY
  rHG Mercurial

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

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
@@ -1045,15 +1045,16 @@
                                      # i18n: "it" refers to an existing branch
                                      hint=_("use 'hg update' to switch to it"))
             scmutil.checknewlabel(repo, label, 'branch')
-            repo.dirstate.setbranch(label)
-            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'))
+            if True:
+                repo.dirstate.setbranch(label)
+                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'))
 
 @command('branches',
     [('a', 'active', False,



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list