More of the same.
Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG75d6139e69f9: changegroup: move close() from narrow
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
durin42 |
hg-reviewers |
More of the same.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/narrow/narrowchangegroup.py (9 lines) | |||
M | mercurial/changegroup.py (7 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Gregory Szorc | Aug 2 2018, 12:52 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
links[fnode] = min(links[fnode], lr, key=clrev) | links[fnode] = min(links[fnode], lr, key=clrev) | ||||
elif fnode: | elif fnode: | ||||
links[fnode] = lr | links[fnode] = lr | ||||
return links | return links | ||||
return orig(self, changedfiles, linknodes, commonrevs, source) | return orig(self, changedfiles, linknodes, commonrevs, source) | ||||
extensions.wrapfunction( | extensions.wrapfunction( | ||||
changegroup.cg1packer, 'generatefiles', generatefiles) | changegroup.cg1packer, 'generatefiles', generatefiles) | ||||
def close(orig, self): | |||||
getattr(self, 'clrev_to_localrev', {}).clear() | |||||
if getattr(self, 'next_clrev_to_localrev', {}): | |||||
self.clrev_to_localrev = self.next_clrev_to_localrev | |||||
del self.next_clrev_to_localrev | |||||
self.changelog_done = True | |||||
return orig(self) | |||||
extensions.wrapfunction(changegroup.cg1packer, 'close', close) | |||||
# In a perfect world, we'd generate better ellipsis-ified graphs | # In a perfect world, we'd generate better ellipsis-ified graphs | ||||
# for non-changelog revlogs. In practice, we haven't started doing | # for non-changelog revlogs. In practice, we haven't started doing | ||||
# that yet, so the resulting DAGs for the manifestlog and filelogs | # that yet, so the resulting DAGs for the manifestlog and filelogs | ||||
# are actually full of bogus parentage on all the ellipsis | # are actually full of bogus parentage on all the ellipsis | ||||
# nodes. This has the side effect that, while the contents are | # nodes. This has the side effect that, while the contents are | ||||
# correct, the individual DAGs might be completely out of whack in | # correct, the individual DAGs might be completely out of whack in | ||||
# a case like 882681bc3166 and its ancestors (back about 10 | # a case like 882681bc3166 and its ancestors (back about 10 | ||||
# revisions or so) in the main hg repo. | # revisions or so) in the main hg repo. |
self._repo = repo | self._repo = repo | ||||
self._reorder = reorder | self._reorder = reorder | ||||
if self._repo.ui.verbose and not self._repo.ui.debugflag: | if self._repo.ui.verbose and not self._repo.ui.debugflag: | ||||
self._verbosenote = self._repo.ui.note | self._verbosenote = self._repo.ui.note | ||||
else: | else: | ||||
self._verbosenote = lambda s: None | self._verbosenote = lambda s: None | ||||
def close(self): | def close(self): | ||||
# Ellipses serving mode. | |||||
getattr(self, 'clrev_to_localrev', {}).clear() | |||||
if getattr(self, 'next_clrev_to_localrev', {}): | |||||
self.clrev_to_localrev = self.next_clrev_to_localrev | |||||
del self.next_clrev_to_localrev | |||||
self.changelog_done = True | |||||
return closechunk() | return closechunk() | ||||
def fileheader(self, fname): | def fileheader(self, fname): | ||||
return chunkheader(len(fname)) + fname | return chunkheader(len(fname)) + fname | ||||
# Extracted both for clarity and for overriding in extensions. | # Extracted both for clarity and for overriding in extensions. | ||||
def _sortgroup(self, revlog, nodelist, lookup): | def _sortgroup(self, revlog, nodelist, lookup): | ||||
"""Sort nodes for change group and turn them into revnums.""" | """Sort nodes for change group and turn them into revnums.""" |