Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 33283:634b259079c5
workingfilectx: add exists, lexists
Switch the lone call in merge.py to use it.
As with past refactors, the goal is to make wctx hot-swappable with an
in-memory context in the future. This change should be a no-op today.
author | Phil Cohen <phillco@fb.com> |
---|---|
date | Tue, 04 Jul 2017 22:35:52 -0700 |
parents | 7017567ebdf2 |
children | b4d517d736a1 |
comparison
equal
deleted
inserted
replaced
33282:d1db7af81548 | 33283:634b259079c5 |
---|---|
7 | 7 |
8 from __future__ import absolute_import | 8 from __future__ import absolute_import |
9 | 9 |
10 import errno | 10 import errno |
11 import hashlib | 11 import hashlib |
12 import os | |
13 import shutil | 12 import shutil |
14 import struct | 13 import struct |
15 | 14 |
16 from .i18n import _ | 15 from .i18n import _ |
17 from .node import ( | 16 from .node import ( |
1204 _files = _('files') | 1203 _files = _('files') |
1205 progress = repo.ui.progress | 1204 progress = repo.ui.progress |
1206 | 1205 |
1207 # remove renamed files after safely stored | 1206 # remove renamed files after safely stored |
1208 for f in moves: | 1207 for f in moves: |
1209 if os.path.lexists(repo.wjoin(f)): | 1208 if wctx[f].lexists(): |
1210 repo.ui.debug("removing %s\n" % f) | 1209 repo.ui.debug("removing %s\n" % f) |
1211 wctx[f].audit() | 1210 wctx[f].audit() |
1212 wctx[f].remove() | 1211 wctx[f].remove() |
1213 | 1212 |
1214 numupdates = sum(len(l) for m, l in actions.items() if m != 'k') | 1213 numupdates = sum(len(l) for m, l in actions.items() if m != 'k') |