applyupdates: assign variable before we try to use it (issue3855)
authorKevin Bullock <kbullock@ringworld.org>
Mon, 18 Mar 2013 16:37:20 -0500
changeset 18780 0705ad73e878
parent 18779 9e39a717a23e
child 18783 b99e62a9b7a2
applyupdates: assign variable before we try to use it (issue3855) The variable 'fd' was getting used with a value left over from a prior iteration, causing a KeyError: '.hgsubstate'.
mercurial/merge.py
--- a/mercurial/merge.py	Mon Mar 18 16:04:10 2013 -0500
+++ b/mercurial/merge.py	Mon Mar 18 16:37:20 2013 -0500
@@ -471,11 +471,11 @@
         f, m, args, msg = a
         progress(_updating, z + i + 1, item=f, total=numupdates, unit=_files)
         if m == "m": # merge
+            f2, fd, move = args
             if fd == '.hgsubstate': # subrepo states need updating
                 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
                                  overwrite)
                 continue
-            f2, fd, move = args
             audit(fd)
             r = ms.resolve(fd, wctx, mctx)
             if r is not None and r > 0: