Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/protocol.py @ 11442:ee1ed6afac21 stable
addchangegroup: pass in lock to release it before changegroup hook is called
Currently, callers of addchangegroup first acquire the repository
lock, usually to check that an unbundle request isn't racing. This
means that changegroup hook actions that might write to a repo get
stuck waiting for a lock. Here, we add a new optional lock parameter
and update all the callers. Post-1.6 we may make it non-optional.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 25 Jun 2010 13:47:28 -0500 |
parents | db3f6f0e4e7d |
children | 26c7d4fc31bf |
comparison
equal
deleted
inserted
replaced
11441:d74fe370ab04 | 11442:ee1ed6afac21 |
---|---|
162 url = 'remote:%s:%s:%s' % ( | 162 url = 'remote:%s:%s:%s' % ( |
163 proto, | 163 proto, |
164 urllib.quote(req.env.get('REMOTE_HOST', '')), | 164 urllib.quote(req.env.get('REMOTE_HOST', '')), |
165 urllib.quote(req.env.get('REMOTE_USER', ''))) | 165 urllib.quote(req.env.get('REMOTE_USER', ''))) |
166 try: | 166 try: |
167 ret = repo.addchangegroup(gen, 'serve', url) | 167 ret = repo.addchangegroup(gen, 'serve', url, lock=lock) |
168 except util.Abort, inst: | 168 except util.Abort, inst: |
169 sys.stdout.write("abort: %s\n" % inst) | 169 sys.stdout.write("abort: %s\n" % inst) |
170 ret = 0 | 170 ret = 0 |
171 finally: | 171 finally: |
172 val = sys.stdout.getvalue() | 172 val = sys.stdout.getvalue() |