Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 14138:c18204fd35b0
scmutil: introduce casecollisionauditor
and cleaning up portability functions
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sat, 30 Apr 2011 23:27:00 +0200 |
parents | 81e6d42b3228 |
children | 135e244776f0 |
comparison
equal
deleted
inserted
replaced
14137:83a94c2fe6f4 | 14138:c18204fd35b0 |
---|---|
1312 bad = [] | 1312 bad = [] |
1313 oldbad = match.bad | 1313 oldbad = match.bad |
1314 match.bad = lambda x, y: bad.append(x) or oldbad(x, y) | 1314 match.bad = lambda x, y: bad.append(x) or oldbad(x, y) |
1315 names = [] | 1315 names = [] |
1316 wctx = repo[None] | 1316 wctx = repo[None] |
1317 existing = None | 1317 cca = None |
1318 if scmutil.showportabilityalert(ui): | 1318 abort, warn = scmutil.checkportabilityalert(ui) |
1319 existing = dict([(fn.lower(), fn) for fn in wctx]) | 1319 if abort or warn: |
1320 cca = scmutil.casecollisionauditor(ui, abort, wctx) | |
1320 for f in repo.walk(match): | 1321 for f in repo.walk(match): |
1321 exact = match.exact(f) | 1322 exact = match.exact(f) |
1322 if exact or f not in repo.dirstate: | 1323 if exact or f not in repo.dirstate: |
1323 if existing: | 1324 if cca: |
1324 scmutil.checkcasecollision(ui, f, existing) | 1325 cca(f) |
1325 names.append(f) | 1326 names.append(f) |
1326 if ui.verbose or not exact: | 1327 if ui.verbose or not exact: |
1327 ui.status(_('adding %s\n') % match.rel(join(f))) | 1328 ui.status(_('adding %s\n') % match.rel(join(f))) |
1328 | 1329 |
1329 if listsubrepos: | 1330 if listsubrepos: |