Mercurial > hg-stable
changeset 26885:8b2fbe3f59b1
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 09 Nov 2015 12:49:21 -0600 |
parents | a24b98f4e03c (current diff) 762bf510b42c (diff) |
children | 4b966aaadc45 |
files | mercurial/posix.py |
diffstat | 7 files changed, 41 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/clonebundles.py Thu Nov 05 17:30:10 2015 -0600 +++ b/hgext/clonebundles.py Mon Nov 09 12:49:21 2015 -0600 @@ -57,7 +57,7 @@ static file hosting services are simple and scalable and should be sufficient for most needs. -Bundle files can be generated with the :hg:`bundle` comand. Typically +Bundle files can be generated with the :hg:`bundle` command. Typically :hg:`bundle --all` is used to produce a bundle of the entire repository. :hg:`debugcreatestreamclonebundle` can be used to produce a special
--- a/mercurial/changegroup.py Thu Nov 05 17:30:10 2015 -0600 +++ b/mercurial/changegroup.py Mon Nov 09 12:49:21 2015 -0600 @@ -322,20 +322,20 @@ changesets = files = revisions = 0 tr = repo.transaction("\n".join([srctype, util.hidepassword(url)])) - # The transaction could have been created before and already - # carries source information. In this case we use the top - # level data. We overwrite the argument because we need to use - # the top level value (if they exist) in this function. - srctype = tr.hookargs.setdefault('source', srctype) - url = tr.hookargs.setdefault('url', url) + try: + # The transaction could have been created before and already + # carries source information. In this case we use the top + # level data. We overwrite the argument because we need to use + # the top level value (if they exist) in this function. + srctype = tr.hookargs.setdefault('source', srctype) + url = tr.hookargs.setdefault('url', url) + repo.hook('prechangegroup', throw=True, **tr.hookargs) - # write changelog data to temp files so concurrent readers will not see - # inconsistent view - cl = repo.changelog - cl.delayupdate(tr) - oldheads = cl.heads() - try: - repo.hook('prechangegroup', throw=True, **tr.hookargs) + # write changelog data to temp files so concurrent readers + # will not see an inconsistent view + cl = repo.changelog + cl.delayupdate(tr) + oldheads = cl.heads() trp = weakref.proxy(tr) # pull off the changeset group @@ -406,10 +406,6 @@ % (changesets, revisions, files, htext)) repo.invalidatevolatilesets() - # Call delayupdate again to ensure the transaction writepending - # subscriptions are still in place. - cl.delayupdate(tr) - if changesets > 0: if 'node' not in tr.hookargs: tr.hookargs['node'] = hex(cl.node(clstart))
--- a/mercurial/demandimport.py Thu Nov 05 17:30:10 2015 -0600 +++ b/mercurial/demandimport.py Mon Nov 09 12:49:21 2015 -0600 @@ -164,7 +164,7 @@ # The name of the module the import statement is located in. globalname = globals.get('__name__') - def processfromitem(mod, attr, **kwargs): + def processfromitem(mod, attr): """Process an imported symbol in the import statement. If the symbol doesn't exist in the parent module, it must be a @@ -172,7 +172,7 @@ """ symbol = getattr(mod, attr, nothing) if symbol is nothing: - symbol = _demandmod(attr, mod.__dict__, locals, **kwargs) + symbol = _demandmod(attr, mod.__dict__, locals, level=1) setattr(mod, attr, symbol) # Record the importing module references this symbol so we can @@ -194,7 +194,7 @@ mod = _hgextimport(_origimport, name, globals, locals, level=level) for x in fromlist: - processfromitem(mod, x, level=level) + processfromitem(mod, x) return mod
--- a/mercurial/hook.py Thu Nov 05 17:30:10 2015 -0600 +++ b/mercurial/hook.py Mon Nov 09 12:49:21 2015 -0600 @@ -122,8 +122,7 @@ # make in-memory changes visible to external process tr = repo.currenttransaction() repo.dirstate.write(tr) - if tr: - tr.writepending() + if tr and tr.writepending(): env['HG_PENDING'] = repo.root for k, v in args.iteritems():
--- a/mercurial/parsers.c Thu Nov 05 17:30:10 2015 -0600 +++ b/mercurial/parsers.c Mon Nov 09 12:49:21 2015 -0600 @@ -2692,7 +2692,7 @@ static PyObject *fm1readmarkers(PyObject *self, PyObject *args) { const char *data, *dataend; - Py_ssize_t datalen; + int datalen; Py_ssize_t offset, stop; PyObject *markers = NULL;
--- a/mercurial/posix.py Thu Nov 05 17:30:10 2015 -0600 +++ b/mercurial/posix.py Mon Nov 09 12:49:21 2015 -0600 @@ -170,22 +170,26 @@ """check whether the given path is on a symlink-capable filesystem""" # mktemp is not racy because symlink creation will fail if the # file already exists - name = tempfile.mktemp(dir=path, prefix='hg-checklink-') - try: - fd = tempfile.NamedTemporaryFile(dir=path, prefix='hg-checklink-') + while True: + name = tempfile.mktemp(dir=path, prefix='hg-checklink-') try: - os.symlink(os.path.basename(fd.name), name) - os.unlink(name) - return True - finally: - fd.close() - except AttributeError: - return False - except OSError as inst: - # sshfs might report failure while successfully creating the link - if inst[0] == errno.EIO and os.path.exists(name): - os.unlink(name) - return False + fd = tempfile.NamedTemporaryFile(dir=path, prefix='hg-checklink-') + try: + os.symlink(os.path.basename(fd.name), name) + os.unlink(name) + return True + except OSError as inst: + # link creation might race, try again + if inst[0] == errno.EEXIST: + continue + # sshfs might report failure while successfully creating the link + if inst[0] == errno.EIO and os.path.exists(name): + os.unlink(name) + return False + finally: + fd.close() + except AttributeError: + return False def checkosfilename(path): '''Check that the base-relative path is a valid filename on this platform.
--- a/tests/test-hook.t Thu Nov 05 17:30:10 2015 -0600 +++ b/tests/test-hook.t Mon Nov 09 12:49:21 2015 -0600 @@ -113,7 +113,7 @@ $ hg pull ../a pulling from ../a searching for changes - prechangegroup hook: HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) + prechangegroup hook: HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) adding changesets adding manifests adding file changes @@ -272,7 +272,7 @@ listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} no changes found pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=push (glob) - prepushkey.forbid hook: HG_BUNDLE2=1 HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:* HG_URL=push (glob) + prepushkey.forbid hook: HG_BUNDLE2=1 HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_SOURCE=push HG_TXNID=TXN:* HG_URL=push (glob) pushkey-abort: prepushkey hook exited with status 1 abort: exporting bookmark baz failed! [255] @@ -306,7 +306,7 @@ $ hg pull ../a pulling from ../a searching for changes - prechangegroup.forbid hook: HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) + prechangegroup.forbid hook: HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob) abort: prechangegroup.forbid hook exited with status 1 [255]