Mercurial > hgsubversion
comparison hg_delta_editor.py @ 73:9c1b53abefcb
fetch_command: support svn copy detection in stupid mode
| author | Patrick Mezard <pmezard@gmail.com> |
|---|---|
| date | Wed, 05 Nov 2008 13:37:08 +0100 |
| parents | 9ec2a12c12ae |
| children | 0d3a2a7cefa3 |
comparison
equal
deleted
inserted
replaced
| 72:9ec2a12c12ae | 73:9c1b53abefcb |
|---|---|
| 497 self.base_revision = base_revision | 497 self.base_revision = base_revision |
| 498 else: | 498 else: |
| 499 self.base_revision = None | 499 self.base_revision = None |
| 500 self.should_edit_most_recent_plaintext = True | 500 self.should_edit_most_recent_plaintext = True |
| 501 | 501 |
| 502 def _aresamefiles(self, parentctx, childctx, files): | 502 def aresamefiles(self, parentctx, childctx, files): |
| 503 """Assuming all files exist in childctx and parentctx, return True | 503 """Assuming all files exist in childctx and parentctx, return True |
| 504 if none of them was changed in-between. | 504 if none of them was changed in-between. |
| 505 """ | 505 """ |
| 506 if parentctx == childctx: | 506 if parentctx == childctx: |
| 507 return True | 507 return True |
| 558 if from_branch == branch: | 558 if from_branch == branch: |
| 559 parentid = self.get_parent_revision(self.current_rev.revnum, | 559 parentid = self.get_parent_revision(self.current_rev.revnum, |
| 560 branch) | 560 branch) |
| 561 if parentid != revlog.nullid: | 561 if parentid != revlog.nullid: |
| 562 parentctx = self.repo.changectx(parentid) | 562 parentctx = self.repo.changectx(parentid) |
| 563 if self._aresamefiles(parentctx, ctx, [from_file]): | 563 if self.aresamefiles(parentctx, ctx, [from_file]): |
| 564 self.copies[path] = from_file | 564 self.copies[path] = from_file |
| 565 | 565 |
| 566 @stash_exception_on_self | 566 @stash_exception_on_self |
| 567 def add_directory(self, path, parent_baton, copyfrom_path, | 567 def add_directory(self, path, parent_baton, copyfrom_path, |
| 568 copyfrom_revision, dir_pool=None): | 568 copyfrom_revision, dir_pool=None): |
| 616 # Preserve the directory copy records if no file was changed between | 616 # Preserve the directory copy records if no file was changed between |
| 617 # the source and destination revisions, or discard it completely. | 617 # the source and destination revisions, or discard it completely. |
| 618 parentid = self.get_parent_revision(self.current_rev.revnum, branch) | 618 parentid = self.get_parent_revision(self.current_rev.revnum, branch) |
| 619 if parentid != revlog.nullid: | 619 if parentid != revlog.nullid: |
| 620 parentctx = self.repo.changectx(parentid) | 620 parentctx = self.repo.changectx(parentid) |
| 621 if self._aresamefiles(parentctx, cp_f_ctx, copies.values()): | 621 if self.aresamefiles(parentctx, cp_f_ctx, copies.values()): |
| 622 self.copies.update(copies) | 622 self.copies.update(copies) |
| 623 | 623 |
| 624 @stash_exception_on_self | 624 @stash_exception_on_self |
| 625 def change_file_prop(self, file_baton, name, value, pool=None): | 625 def change_file_prop(self, file_baton, name, value, pool=None): |
| 626 if name == 'svn:executable': | 626 if name == 'svn:executable': |
