Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 23534:83bbedc16b3f
addremove: warn when addremove fails to operate on a named path
It looks like a bad path is the only mode of failure for addremove. This
warning is probably useful for the standalone command, but more important for
'commit -A'. That command doesn't currently abort if the addremove fails, but
it will be made to do so prior to adding subrepo support, since not all subrepos
will support addremove. We could just abort here, but it looks like addremove
has always silently ignored bad paths, except for the exit code.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 26 Nov 2014 14:27:36 -0500 |
parents | 891aaa7c0c70 |
children | f1b06a8aad42 |
comparison
equal
deleted
inserted
replaced
23533:891aaa7c0c70 | 23534:83bbedc16b3f |
---|---|
719 dry_run = opts.get('dry_run') | 719 dry_run = opts.get('dry_run') |
720 if similarity is None: | 720 if similarity is None: |
721 similarity = float(opts.get('similarity') or 0) | 721 similarity = float(opts.get('similarity') or 0) |
722 | 722 |
723 rejected = [] | 723 rejected = [] |
724 m.bad = lambda x, y: rejected.append(x) | 724 origbad = m.bad |
725 | 725 def badfn(f, msg): |
726 if f in m.files(): | |
727 origbad(f, msg) | |
728 rejected.append(f) | |
729 | |
730 m.bad = badfn | |
726 added, unknown, deleted, removed, forgotten = _interestingfiles(repo, m) | 731 added, unknown, deleted, removed, forgotten = _interestingfiles(repo, m) |
732 m.bad = origbad | |
727 | 733 |
728 unknownset = set(unknown + forgotten) | 734 unknownset = set(unknown + forgotten) |
729 toprint = unknownset.copy() | 735 toprint = unknownset.copy() |
730 toprint.update(deleted) | 736 toprint.update(deleted) |
731 for abs in sorted(toprint): | 737 for abs in sorted(toprint): |