Show More
@@ -686,9 +686,9 b' def addremove(repo, pats=[], opts={}, dr' | |||
|
686 | 686 | rejected = [] |
|
687 | 687 | m.bad = lambda x, y: rejected.append(x) |
|
688 | 688 | |
|
689 | added, unknown, deleted, removed = _interestingfiles(repo, m) | |
|
689 | added, unknown, deleted, removed, forgotten = _interestingfiles(repo, m) | |
|
690 | 690 | |
|
691 | unknownset = set(unknown) | |
|
691 | unknownset = set(unknown + forgotten) | |
|
692 | 692 | toprint = unknownset.copy() |
|
693 | 693 | toprint.update(deleted) |
|
694 | 694 | for abs in sorted(toprint): |
@@ -704,7 +704,7 b' def addremove(repo, pats=[], opts={}, dr' | |||
|
704 | 704 | similarity) |
|
705 | 705 | |
|
706 | 706 | if not dry_run: |
|
707 | _markchanges(repo, unknown, deleted, renames) | |
|
707 | _markchanges(repo, unknown + forgotten, deleted, renames) | |
|
708 | 708 | |
|
709 | 709 | for f in rejected: |
|
710 | 710 | if f in m.files(): |
@@ -718,10 +718,10 b' def marktouched(repo, files, similarity=' | |||
|
718 | 718 | rejected = [] |
|
719 | 719 | m.bad = lambda x, y: rejected.append(x) |
|
720 | 720 | |
|
721 | added, unknown, deleted, removed = _interestingfiles(repo, m) | |
|
721 | added, unknown, deleted, removed, forgotten = _interestingfiles(repo, m) | |
|
722 | 722 | |
|
723 | 723 | if repo.ui.verbose: |
|
724 | unknownset = set(unknown) | |
|
724 | unknownset = set(unknown + forgotten) | |
|
725 | 725 | toprint = unknownset.copy() |
|
726 | 726 | toprint.update(deleted) |
|
727 | 727 | for abs in sorted(toprint): |
@@ -734,7 +734,7 b' def marktouched(repo, files, similarity=' | |||
|
734 | 734 | renames = _findrenames(repo, m, added + unknown, removed + deleted, |
|
735 | 735 | similarity) |
|
736 | 736 | |
|
737 | _markchanges(repo, unknown, deleted, renames) | |
|
737 | _markchanges(repo, unknown + forgotten, deleted, renames) | |
|
738 | 738 | |
|
739 | 739 | for f in rejected: |
|
740 | 740 | if f in m.files(): |
@@ -747,7 +747,7 b' def _interestingfiles(repo, matcher):' | |||
|
747 | 747 | |
|
748 | 748 | This is different from dirstate.status because it doesn't care about |
|
749 | 749 | whether files are modified or clean.''' |
|
750 | added, unknown, deleted, removed = [], [], [], [] | |
|
750 | added, unknown, deleted, removed, forgotten = [], [], [], [], [] | |
|
751 | 751 | audit_path = pathutil.pathauditor(repo.root) |
|
752 | 752 | |
|
753 | 753 | ctx = repo[None] |
@@ -760,13 +760,15 b' def _interestingfiles(repo, matcher):' | |||
|
760 | 760 | unknown.append(abs) |
|
761 | 761 | elif dstate != 'r' and not st: |
|
762 | 762 | deleted.append(abs) |
|
763 | elif dstate == 'r' and st: | |
|
764 | forgotten.append(abs) | |
|
763 | 765 | # for finding renames |
|
764 | elif dstate == 'r': | |
|
766 | elif dstate == 'r' and not st: | |
|
765 | 767 | removed.append(abs) |
|
766 | 768 | elif dstate == 'a': |
|
767 | 769 | added.append(abs) |
|
768 | 770 | |
|
769 | return added, unknown, deleted, removed | |
|
771 | return added, unknown, deleted, removed, forgotten | |
|
770 | 772 | |
|
771 | 773 | def _findrenames(repo, matcher, added, removed, similarity): |
|
772 | 774 | '''Find renames from removed files to added ones.''' |
@@ -18,7 +18,11 b'' | |||
|
18 | 18 | dir/bar_2 |
|
19 | 19 | foo_2 |
|
20 | 20 | committed changeset 1:e65414bf35c5 |
|
21 |
$ cd .. |
|
|
21 | $ cd .. | |
|
22 | $ hg forget foo | |
|
23 | $ hg -v addremove | |
|
24 | adding foo | |
|
25 | $ cd .. | |
|
22 | 26 | |
|
23 | 27 | $ hg init sim |
|
24 | 28 | $ cd sim |
@@ -45,4 +49,9 b'' | |||
|
45 | 49 | adding d |
|
46 | 50 | recording removal of a as rename to b (100% similar) |
|
47 | 51 | $ hg commit -mb |
|
52 | $ cp b c | |
|
53 | $ hg forget b | |
|
54 | $ hg addremove -s 50 | |
|
55 | adding b | |
|
56 | adding c | |
|
48 | 57 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now