commit: reduce scope of 'removed' variable
authorMartin von Zweigbergk <martinvonz@gmail.com>
Mon, 13 Oct 2014 16:43:37 -0700
changeset 22907 a337f4b9b99d
parent 22906 75d0edb68b41
child 22908 71570f310417
commit: reduce scope of 'removed' variable The variable is closely related to 'added' and 'changed', so it makes sense to have it declared next to them.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Oct 13 18:00:39 2014 -0500
+++ b/mercurial/localrepo.py	Mon Oct 13 16:43:37 2014 -0700
@@ -1378,7 +1378,6 @@
         """
 
         tr = lock = None
-        removed = list(ctx.removed())
         p1, p2 = ctx.p1(), ctx.p2()
         user = ctx.user()
 
@@ -1394,6 +1393,7 @@
                 # check in files
                 new = {}
                 changed = []
+                removed = list(ctx.removed())
                 linkrev = len(self)
                 for f in sorted(ctx.modified() + ctx.added()):
                     self.ui.note(f + "\n")