changeset 22233:4ab61b24e20c

revert: simplify loop conditional The two breaks can be joined into one. The code gains one level of indent.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 01 Aug 2014 11:41:56 -0700
parents 91df98701e9e
children fe9fc29ac2d0
files mercurial/cmdutil.py
diffstat 1 files changed, 15 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue Jun 24 18:04:13 2014 +0100
+++ b/mercurial/cmdutil.py	Fri Aug 01 11:41:56 2014 -0700
@@ -2500,22 +2500,21 @@
             for table, (xlist, msg), dobackup in disptable:
                 if abs not in table:
                     continue
-                if xlist is None:
-                    if exact:
-                        ui.warn(_('no changes needed to %s\n') % rel)
-                    break
-                xlist.append(abs)
-                if (dobackup and os.path.lexists(target) and
-                    abs in ctx and repo[None][abs].cmp(ctx[abs])):
-                    bakname = "%s.orig" % rel
-                    ui.note(_('saving current version of %s as %s\n') %
-                            (rel, bakname))
-                    if not opts.get('dry_run'):
-                        util.rename(target, bakname)
-                if ui.verbose or not exact:
-                    if not isinstance(msg, basestring):
-                        msg = msg(abs)
-                    ui.status(msg % rel)
+                if xlist is not None:
+                    xlist.append(abs)
+                    if (dobackup and os.path.lexists(target) and
+                        abs in ctx and repo[None][abs].cmp(ctx[abs])):
+                        bakname = "%s.orig" % rel
+                        ui.note(_('saving current version of %s as %s\n') %
+                                (rel, bakname))
+                        if not opts.get('dry_run'):
+                            util.rename(target, bakname)
+                    if ui.verbose or not exact:
+                        if not isinstance(msg, basestring):
+                            msg = msg(abs)
+                        ui.status(msg % rel)
+                elif exact:
+                    ui.warn(_('no changes needed to %s\n') % rel)
                 break
             else:
                 # Not touched in current dirstate.