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

This is an archive of the discontinued Mercurial Phabricator instance.

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

Authored by pulkit on Oct 14 2017, 10:41 AM.

Details

Reviewers
dlax
Group Reviewers
hg-reviewers
Summary

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

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Oct 14 2017, 10:41 AM
dlax requested changes to this revision.Oct 15 2017, 4:40 AM
dlax added a subscriber: dlax.
dlax added inline comments.
mercurial/commands.py
1048

Instead of this, you could use an early return in the next patch as:

--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1045,6 +1045,10 @@ def branch(ui, repo, label=None, **opts)
                                      # i18n: "it" refers to an existing branch
                                      hint=_("use 'hg update' to switch to it"))
             scmutil.checknewlabel(repo, label, 'branch')
+
+            if revs:
+                return cmdutil.changebranch(ui, repo, revs, label)
+
             repo.dirstate.setbranch(label)
             ui.status(_('marked working directory as branch %s\n') % label)

and drop this one.

This revision now requires changes to proceed.Oct 15 2017, 4:40 AM
pulkit abandoned this revision.Oct 15 2017, 1:57 PM