applyupdates: assign variable before we try to use it (issue3855) stable 2.5.4
authorKevin Bullock <kbullock@ringworld.org>
Mon, 18 Mar 2013 16:37:20 -0500
branchstable
changeset 18873 8a7bd2dccd44
parent 18866 930d54b1fd29
child 18874 64d751a93bf7
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	Tue Apr 02 16:03:10 2013 +0200
+++ b/mercurial/merge.py	Mon Mar 18 16:37:20 2013 -0500
@@ -382,11 +382,11 @@
                              (f, inst.strerror))
             removed += 1
         elif m == "m": # merge
+            f2, fd, move = a[2:]
             if fd == '.hgsubstate': # subrepo states need updating
                 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
                                  overwrite)
                 continue
-            f2, fd, move = a[2:]
             audit(fd)
             r = ms.resolve(fd, wctx, mctx)
             if r is not None and r > 0: