comparison mercurial/merge.py @ 18873:8a7bd2dccd44 stable 2.5.4

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'.
author Kevin Bullock <kbullock@ringworld.org>
date Mon, 18 Mar 2013 16:37:20 -0500
parents 9de9727cea53
children f63035b9b38a
comparison
equal deleted inserted replaced
18866:930d54b1fd29 18873:8a7bd2dccd44
380 except OSError, inst: 380 except OSError, inst:
381 repo.ui.warn(_("update failed to remove %s: %s!\n") % 381 repo.ui.warn(_("update failed to remove %s: %s!\n") %
382 (f, inst.strerror)) 382 (f, inst.strerror))
383 removed += 1 383 removed += 1
384 elif m == "m": # merge 384 elif m == "m": # merge
385 f2, fd, move = a[2:]
385 if fd == '.hgsubstate': # subrepo states need updating 386 if fd == '.hgsubstate': # subrepo states need updating
386 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), 387 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx),
387 overwrite) 388 overwrite)
388 continue 389 continue
389 f2, fd, move = a[2:]
390 audit(fd) 390 audit(fd)
391 r = ms.resolve(fd, wctx, mctx) 391 r = ms.resolve(fd, wctx, mctx)
392 if r is not None and r > 0: 392 if r is not None and r > 0:
393 unresolved += 1 393 unresolved += 1
394 else: 394 else: