Mercurial > hg
comparison mercurial/localrepo.py @ 20931:de60ca3a390e
localrepo: move the changegroup method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.
The method had few callers, not enough to be kept in local repo.
The peer API stay unchanged.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 01 Apr 2014 15:08:27 -0700 |
parents | 4a987060d97e |
children | 0ac83e4e4f7c |
comparison
equal
deleted
inserted
replaced
20930:4a987060d97e | 20931:de60ca3a390e |
---|---|
138 | 138 |
139 def between(self, pairs): | 139 def between(self, pairs): |
140 return self._repo.between(pairs) | 140 return self._repo.between(pairs) |
141 | 141 |
142 def changegroup(self, basenodes, source): | 142 def changegroup(self, basenodes, source): |
143 return self._repo.changegroup(basenodes, source) | 143 return changegroup.changegroup(self._repo, basenodes, source) |
144 | 144 |
145 def changegroupsubset(self, bases, heads, source): | 145 def changegroupsubset(self, bases, heads, source): |
146 return changegroup.changegroupsubset(self._repo, bases, heads, source) | 146 return changegroup.changegroupsubset(self._repo, bases, heads, source) |
147 | 147 |
148 class localrepository(object): | 148 class localrepository(object): |
1681 pass | 1681 pass |
1682 | 1682 |
1683 def push(self, remote, force=False, revs=None, newbranch=False): | 1683 def push(self, remote, force=False, revs=None, newbranch=False): |
1684 return exchange.push(self, remote, force, revs, newbranch) | 1684 return exchange.push(self, remote, force, revs, newbranch) |
1685 | 1685 |
1686 def changegroup(self, basenodes, source): | |
1687 # to avoid a race we use changegroupsubset() (issue1320) | |
1688 return changegroup.changegroupsubset(self, basenodes, self.heads(), | |
1689 source) | |
1690 | |
1691 @unfilteredmethod | 1686 @unfilteredmethod |
1692 def addchangegroup(self, source, srctype, url, emptyok=False): | 1687 def addchangegroup(self, source, srctype, url, emptyok=False): |
1693 """Add the changegroup returned by source.read() to this repo. | 1688 """Add the changegroup returned by source.read() to this repo. |
1694 srctype is a string like 'push', 'pull', or 'unbundle'. url is | 1689 srctype is a string like 'push', 'pull', or 'unbundle'. url is |
1695 the URL of the repo where this changegroup is coming from. | 1690 the URL of the repo where this changegroup is coming from. |