changeset 28199:d49793aac1ac

merge: indent code in batchget() To make the next patch easier to read.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 20 Feb 2016 15:27:11 -0800
parents ddc07ddcca94
children 588695ccbb22
files mercurial/merge.py
diffstat 1 files changed, 22 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Sat Feb 20 15:25:27 2016 -0800
+++ b/mercurial/merge.py	Sat Feb 20 15:27:11 2016 -0800
@@ -1058,29 +1058,30 @@
     wwrite = repo.wwrite
     ui = repo.ui
     i = 0
-    for f, (flags, backup), msg in actions:
-        repo.ui.debug(" %s: %s -> g\n" % (f, msg))
-        if verbose:
-            repo.ui.note(_("getting %s\n") % f)
+    if True:
+        for f, (flags, backup), msg in actions:
+            repo.ui.debug(" %s: %s -> g\n" % (f, msg))
+            if verbose:
+                repo.ui.note(_("getting %s\n") % f)
 
-        if backup:
-            absf = repo.wjoin(f)
-            orig = scmutil.origpath(ui, repo, absf)
-            try:
-                # TODO Mercurial has always aborted if an untracked directory
-                # is replaced by a tracked file, or generally with
-                # file/directory merges. This needs to be sorted out.
-                if repo.wvfs.isfileorlink(f):
-                    util.rename(absf, orig)
-            except OSError as e:
-                if e.errno != errno.ENOENT:
-                    raise
+            if backup:
+                absf = repo.wjoin(f)
+                orig = scmutil.origpath(ui, repo, absf)
+                try:
+                    # TODO Mercurial has always aborted if an untracked
+                    # directory is replaced by a tracked file, or generally
+                    # with file/directory merges. This needs to be sorted out.
+                    if repo.wvfs.isfileorlink(f):
+                        util.rename(absf, orig)
+                except OSError as e:
+                    if e.errno != errno.ENOENT:
+                        raise
 
-        wwrite(f, fctx(f).data(), flags)
-        if i == 100:
-            yield i, f
-            i = 0
-        i += 1
+            wwrite(f, fctx(f).data(), flags)
+            if i == 100:
+                yield i, f
+                i = 0
+            i += 1
     if i > 0:
         yield i, f