[PATCH 3 of 4] parsers: indentation change to make the next patch more legible

Laurent Charignon lcharignon at fb.com
Tue Nov 24 19:19:10 CST 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1448411871 28800
#      Tue Nov 24 16:37:51 2015 -0800
# Node ID 5c7759228e340435b6b391aa080342f97e548821
# Parent  ea9d03d4e85ea3949bb8d16bd9e1a80246a8247b
parsers: indentation change to make the next patch more legible

The next patch changes indentation and to make it easier to review, this patch
contains only the indentation change.

diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -88,23 +88,24 @@
     cs = cStringIO.StringIO()
     write = cs.write
     write("".join(pl))
-    for f, e in dmap.iteritems():
-        if e[0] == 'n' and e[3] == now:
-            # The file was last modified "simultaneously" with the current
-            # write to dirstate (i.e. within the same second for file-
-            # systems with a granularity of 1 sec). This commonly happens
-            # for at least a couple of files on 'update'.
-            # The user could change the file without changing its size
-            # within the same second. Invalidate the file's mtime in
-            # dirstate, forcing future 'status' calls to compare the
-            # contents of the file if the size is the same. This prevents
-            # mistakenly treating such files as clean.
-            e = dirstatetuple(e[0], e[1], e[2], -1)
-            dmap[f] = e
+    if True:
+        for f, e in dmap.iteritems():
+            if e[0] == 'n' and e[3] == now:
+                # The file was last modified "simultaneously" with the current
+                # write to dirstate (i.e. within the same second for file-
+                # systems with a granularity of 1 sec). This commonly happens
+                # for at least a couple of files on 'update'.
+                # The user could change the file without changing its size
+                # within the same second. Invalidate the file's mtime in
+                # dirstate, forcing future 'status' calls to compare the
+                # contents of the file if the size is the same. This prevents
+                # mistakenly treating such files as clean.
+                e = dirstatetuple(e[0], e[1], e[2], -1)
+                dmap[f] = e
 
-        if f in copymap:
-            f = "%s\0%s" % (f, copymap[f])
-        e = _pack(">cllll", e[0], e[1], e[2], e[3], len(f))
-        write(e)
-        write(f)
+            if f in copymap:
+                f = "%s\0%s" % (f, copymap[f])
+            e = _pack(">cllll", e[0], e[1], e[2], e[3], len(f))
+            write(e)
+            write(f)
     return cs.getvalue()


More information about the Mercurial-devel mailing list