Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG2e2076c8c25f: commit: migrate to new method for getting copy info
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | mercurial/localrepo.py (5 lines) | |||
| M | tests/drawdag.py (2 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| Martin von Zweigbergk | Dec 28 2017, 1:31 AM |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz |
| if node in [fparent1, fparent2]: | if node in [fparent1, fparent2]: | ||||
| self.ui.debug('reusing %s filelog entry\n' % fname) | self.ui.debug('reusing %s filelog entry\n' % fname) | ||||
| if manifest1.flags(fname) != fctx.flags(): | if manifest1.flags(fname) != fctx.flags(): | ||||
| changelist.append(fname) | changelist.append(fname) | ||||
| return node | return node | ||||
| flog = self.file(fname) | flog = self.file(fname) | ||||
| meta = {} | meta = {} | ||||
| copy = fctx.renamed() | cfname = fctx.copysource() | ||||
| if copy and copy[0] != fname: | if cfname and cfname != fname: | ||||
| # Mark the new revision of this file as a copy of another | # Mark the new revision of this file as a copy of another | ||||
| # file. This copy data will effectively act as a parent | # file. This copy data will effectively act as a parent | ||||
| # of this new revision. If this is a merge, the first | # of this new revision. If this is a merge, the first | ||||
| # parent will be the nullid (meaning "look up the copy data") | # parent will be the nullid (meaning "look up the copy data") | ||||
| # and the second one will be the other parent. For example: | # and the second one will be the other parent. For example: | ||||
| # | # | ||||
| # 0 --- 1 --- 3 rev1 changes file foo | # 0 --- 1 --- 3 rev1 changes file foo | ||||
| # \ / rev2 renames foo to bar and changes it | # \ / rev2 renames foo to bar and changes it | ||||
| # \- 2 -/ rev3 should have bar with all changes and | # \- 2 -/ rev3 should have bar with all changes and | ||||
| # should record that bar descends from | # should record that bar descends from | ||||
| # bar in rev2 and foo in rev1 | # bar in rev2 and foo in rev1 | ||||
| # | # | ||||
| # this allows this merge to succeed: | # this allows this merge to succeed: | ||||
| # | # | ||||
| # 0 --- 1 --- 3 rev4 reverts the content change from rev2 | # 0 --- 1 --- 3 rev4 reverts the content change from rev2 | ||||
| # \ / merging rev3 and rev4 should use bar@rev2 | # \ / merging rev3 and rev4 should use bar@rev2 | ||||
| # \- 2 --- 4 as the merge base | # \- 2 --- 4 as the merge base | ||||
| # | # | ||||
| cfname = copy[0] | |||||
| crev = manifest1.get(cfname) | crev = manifest1.get(cfname) | ||||
| newfparent = fparent2 | newfparent = fparent2 | ||||
| if manifest2: # branch merge | if manifest2: # branch merge | ||||
| if fparent2 == nullid or crev is None: # copied on remote side | if fparent2 == nullid or crev is None: # copied on remote side | ||||
| if cfname in manifest2: | if cfname in manifest2: | ||||
| crev = manifest2[cfname] | crev = manifest2[cfname] | ||||
| newfparent = fparent1 | newfparent = fparent1 | ||||
| return self._data | return self._data | ||||
| def filenode(self): | def filenode(self): | ||||
| return None | return None | ||||
| def path(self): | def path(self): | ||||
| return self._path | return self._path | ||||
| def renamed(self): | def copysource(self): | ||||
| return None | return None | ||||
| def flags(self): | def flags(self): | ||||
| return b'' | return b'' | ||||
| class simplecommitctx(context.committablectx): | class simplecommitctx(context.committablectx): | ||||
| def __init__(self, repo, name, parentctxs, added): | def __init__(self, repo, name, parentctxs, added): | ||||
| opts = { | opts = { | ||||