Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 18328:2fee5119099b
merge: consistently use repo.wopener.audit instead of creating a new auditor
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Wed, 09 Jan 2013 00:01:33 +0100 |
parents | 242d2f4ec01c |
children | eb6ca96f4dd0 |
comparison
equal
deleted
inserted
replaced
18327:4aecdb91443c | 18328:2fee5119099b |
---|---|
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 from node import nullid, nullrev, hex, bin | 8 from node import nullid, nullrev, hex, bin |
9 from i18n import _ | 9 from i18n import _ |
10 import error, scmutil, util, filemerge, copies, subrepo | 10 import error, util, filemerge, copies, subrepo |
11 import errno, os, shutil | 11 import errno, os, shutil |
12 | 12 |
13 class mergestate(object): | 13 class mergestate(object): |
14 '''track 3-way merge state of individual files''' | 14 '''track 3-way merge state of individual files''' |
15 def __init__(self, repo): | 15 def __init__(self, repo): |
358 fca = repo.filectx(f, fileid=nullrev) | 358 fca = repo.filectx(f, fileid=nullrev) |
359 ms.add(fcl, fco, fca, fd, flags) | 359 ms.add(fcl, fco, fca, fd, flags) |
360 if f != fd and move: | 360 if f != fd and move: |
361 moves.append(f) | 361 moves.append(f) |
362 | 362 |
363 audit = scmutil.pathauditor(repo.root) | 363 audit = repo.wopener.audit |
364 | 364 |
365 # remove renamed files after safely stored | 365 # remove renamed files after safely stored |
366 for f in moves: | 366 for f in moves: |
367 if os.path.lexists(repo.wjoin(f)): | 367 if os.path.lexists(repo.wjoin(f)): |
368 repo.ui.debug("removing %s\n" % f) | 368 repo.ui.debug("removing %s\n" % f) |
391 if f == '.hgsubstate': # subrepo states need updating | 391 if f == '.hgsubstate': # subrepo states need updating |
392 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), | 392 subrepo.submerge(repo, wctx, mctx, wctx.ancestor(mctx), |
393 overwrite) | 393 overwrite) |
394 continue | 394 continue |
395 f2, fd, flags, move = a[2:] | 395 f2, fd, flags, move = a[2:] |
396 repo.wopener.audit(fd) | 396 audit(fd) |
397 r = ms.resolve(fd, wctx, mctx) | 397 r = ms.resolve(fd, wctx, mctx) |
398 if r is not None and r > 0: | 398 if r is not None and r > 0: |
399 unresolved += 1 | 399 unresolved += 1 |
400 else: | 400 else: |
401 if r is None: | 401 if r is None: |
441 "and renamed to:\n") % f) | 441 "and renamed to:\n") % f) |
442 for nf in fl: | 442 for nf in fl: |
443 repo.ui.warn(" %s\n" % nf) | 443 repo.ui.warn(" %s\n" % nf) |
444 elif m == "e": # exec | 444 elif m == "e": # exec |
445 flags = a[2] | 445 flags = a[2] |
446 repo.wopener.audit(f) | 446 audit(f) |
447 util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags) | 447 util.setflags(repo.wjoin(f), 'l' in flags, 'x' in flags) |
448 ms.commit() | 448 ms.commit() |
449 repo.ui.progress(_('updating'), None, total=numupdates, unit=_('files')) | 449 repo.ui.progress(_('updating'), None, total=numupdates, unit=_('files')) |
450 | 450 |
451 return updated, merged, removed, unresolved | 451 return updated, merged, removed, unresolved |