Show More
@@ -707,15 +707,7 def addremove(repo, pats=[], opts={}, dr | |||||
707 | similarity) |
|
707 | similarity) | |
708 |
|
708 | |||
709 | if not dry_run: |
|
709 | if not dry_run: | |
710 | wctx = repo[None] |
|
710 | _markchanges(repo, unknown, deleted, renames) | |
711 | wlock = repo.wlock() |
|
|||
712 | try: |
|
|||
713 | wctx.forget(deleted) |
|
|||
714 | wctx.add(unknown) |
|
|||
715 | for new, old in renames.iteritems(): |
|
|||
716 | wctx.copy(old, new) |
|
|||
717 | finally: |
|
|||
718 | wlock.release() |
|
|||
719 |
|
711 | |||
720 | for f in rejected: |
|
712 | for f in rejected: | |
721 | if f in m.files(): |
|
713 | if f in m.files(): | |
@@ -763,6 +755,19 def _findrenames(repo, matcher, added, r | |||||
763 | renames[new] = old |
|
755 | renames[new] = old | |
764 | return renames |
|
756 | return renames | |
765 |
|
757 | |||
|
758 | def _markchanges(repo, unknown, deleted, renames): | |||
|
759 | '''Marks the files in unknown as added, the files in deleted as removed, | |||
|
760 | and the files in renames as copied.''' | |||
|
761 | wctx = repo[None] | |||
|
762 | wlock = repo.wlock() | |||
|
763 | try: | |||
|
764 | wctx.forget(deleted) | |||
|
765 | wctx.add(unknown) | |||
|
766 | for new, old in renames.iteritems(): | |||
|
767 | wctx.copy(old, new) | |||
|
768 | finally: | |||
|
769 | wlock.release() | |||
|
770 | ||||
766 | def dirstatecopy(ui, repo, wctx, src, dst, dryrun=False, cwd=None): |
|
771 | def dirstatecopy(ui, repo, wctx, src, dst, dryrun=False, cwd=None): | |
767 | """Update the dirstate to reflect the intent of copying src to dst. For |
|
772 | """Update the dirstate to reflect the intent of copying src to dst. For | |
768 | different reasons it might not end with dst being marked as copied from src. |
|
773 | different reasons it might not end with dst being marked as copied from src. |
General Comments 0
You need to be logged in to leave comments.
Login now