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