##// END OF EJS Templates
addchangegroup: remove the lock argument on the addchangegroup methods...
Pierre-Yves David -
r15585:a348739d default
parent child Browse files
Show More
@@ -5575,8 +5575,7 b' def unbundle(ui, repo, fname1, *fnames, '
5575 5575 for fname in fnames:
5576 5576 f = url.open(ui, fname)
5577 5577 gen = changegroup.readbundle(f, fname)
5578 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname,
5579 lock=lock)
5578 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname)
5580 5579 bookmarks.updatecurrentbookmark(repo, wc.node(), wc.branch())
5581 5580 finally:
5582 5581 lock.release()
@@ -1527,8 +1527,7 b' class localrepository(repo.repository):'
1527 1527 "changegroupsubset."))
1528 1528 else:
1529 1529 cg = remote.changegroupsubset(fetch, heads, 'pull')
1530 result = self.addchangegroup(cg, 'pull', remote.url(),
1531 lock=lock)
1530 result = self.addchangegroup(cg, 'pull', remote.url())
1532 1531 phases.advanceboundary(self, 0, common)
1533 1532 finally:
1534 1533 lock.release()
@@ -1583,8 +1582,7 b' class localrepository(repo.repository):'
1583 1582 ret = remote.unbundle(cg, remote_heads, 'push')
1584 1583 else:
1585 1584 # we return an integer indicating remote head count change
1586 ret = remote.addchangegroup(cg, 'push', self.url(),
1587 lock=lock)
1585 ret = remote.addchangegroup(cg, 'push', self.url())
1588 1586 # if we don't push, the common data is already useful
1589 1587 # everything exchange is public for now
1590 1588 phases.advanceboundary(self, 0, fut)
@@ -1849,12 +1847,10 b' class localrepository(repo.repository):'
1849 1847
1850 1848 return changegroup.unbundle10(util.chunkbuffer(gengroup()), 'UN')
1851 1849
1852 def addchangegroup(self, source, srctype, url, emptyok=False, lock=None):
1850 def addchangegroup(self, source, srctype, url, emptyok=False):
1853 1851 """Add the changegroup returned by source.read() to this repo.
1854 1852 srctype is a string like 'push', 'pull', or 'unbundle'. url is
1855 1853 the URL of the repo where this changegroup is coming from.
1856 If lock is not None, the function takes ownership of the lock
1857 and releases it after the changegroup is added.
1858 1854
1859 1855 Return an integer summarizing the change to this repo:
1860 1856 - nothing changed or no source: 0
@@ -2019,8 +2015,6 b' class localrepository(repo.repository):'
2019 2015
2020 2016 finally:
2021 2017 tr.release()
2022 if lock:
2023 lock.release()
2024 2018 # never return 0 here:
2025 2019 if dh < 0:
2026 2020 return dh - 1
@@ -142,8 +142,8 b' class sshserver(object):'
142 142
143 143 self.sendresponse("")
144 144 cg = changegroup.unbundle10(self.fin, "UN")
145 r = self.repo.addchangegroup(cg, 'serve', self._client(),
146 lock=self.lock)
145 r = self.repo.addchangegroup(cg, 'serve', self._client())
146 self.lock.release()
147 147 return str(r)
148 148
149 149 def _client(self):
@@ -574,8 +574,7 b' def unbundle(repo, proto, heads):'
574 574 gen = changegroupmod.readbundle(fp, None)
575 575
576 576 try:
577 r = repo.addchangegroup(gen, 'serve', proto._client(),
578 lock=lock)
577 r = repo.addchangegroup(gen, 'serve', proto._client())
579 578 except util.Abort, inst:
580 579 sys.stderr.write("abort: %s\n" % inst)
581 580 finally:
General Comments 0
You need to be logged in to leave comments. Login now