# HG changeset patch # User Matt Mackall # Date 1337058055 -7200 # Node ID 3e24ce3de5f179e691020f48c66fe86d2d4c5022 # Parent 68da5ae6e470b1c3a7a453b4e881f1531f7189a0# Parent 7002bb17cc5eceb8c1ab792bdaf10bd96c08c8d8 merge with stable diff -r 68da5ae6e470 -r 3e24ce3de5f1 hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py Sun May 13 22:59:22 2012 +0200 +++ b/hgext/largefiles/lfcommands.py Tue May 15 07:00:55 2012 +0200 @@ -14,6 +14,7 @@ from mercurial import util, match as match_, hg, node, context, error, \ cmdutil, scmutil from mercurial.i18n import _ +from mercurial.lock import release import lfutil import basestore @@ -55,10 +56,12 @@ rdst = hg.repository(ui, dest, create=True) success = False + dstwlock = dstlock = None try: # Lock destination to prevent modification while it is converted to. # Don't need to lock src because we are just reading from its history # which can't change. + dstwlock = rdst.wlock() dstlock = rdst.lock() # Get a list of all changesets in the source. The easy way to do this @@ -111,10 +114,11 @@ ui.progress(_('converting revisions'), None) success = True finally: + rdst.dirstate.clear() + release(dstlock, dstwlock) if not success: # we failed, remove the new directory shutil.rmtree(rdst.root) - dstlock.release() def _addchangeset(ui, rsrc, rdst, ctx, revmap): # Convert src parents to dst parents diff -r 68da5ae6e470 -r 3e24ce3de5f1 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Sun May 13 22:59:22 2012 +0200 +++ b/mercurial/hgweb/webcommands.py Tue May 15 07:00:55 2012 +0200 @@ -558,6 +558,7 @@ if fctx is not None: n = fctx.node() path = fctx.path() + ctx = fctx.changectx() else: n = ctx.node() # path already defined in except clause @@ -567,7 +568,7 @@ if 'style' in req.form: style = req.form['style'][0] - diffs = webutil.diffs(web.repo, tmpl, fctx or ctx, [path], parity, style) + diffs = webutil.diffs(web.repo, tmpl, ctx, [path], parity, style) rename = fctx and webutil.renamelink(fctx) or [] ctx = fctx and fctx or ctx return tmpl("filediff", diff -r 68da5ae6e470 -r 3e24ce3de5f1 mercurial/posix.py --- a/mercurial/posix.py Sun May 13 22:59:22 2012 +0200 +++ b/mercurial/posix.py Tue May 15 07:00:55 2012 +0200 @@ -409,10 +409,13 @@ continue if not os.isatty(fd): continue - arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8) - width = array.array('h', arri)[1] - if width > 0: - return width + try: + arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8) + width = array.array('h', arri)[1] + if width > 0: + return width + except AttributeError: + pass except ValueError: pass except IOError, e: diff -r 68da5ae6e470 -r 3e24ce3de5f1 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Sun May 13 22:59:22 2012 +0200 +++ b/tests/test-hgweb-commands.t Tue May 15 07:00:55 2012 +0200 @@ -663,15 +663,24 @@ + $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/filediff/0/foo/?style=raw' + 200 Script output follows + + + diff -r 000000000000 -r 2ef0ac749a14 foo + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/foo Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +foo + + + + + $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/filediff/1/foo/?style=raw' 200 Script output follows - diff -r 000000000000 -r a4f92ed23982 foo - --- /dev/null Thu Jan 01 00:00:00 1970 +0000 - +++ b/foo Thu Jan 01 00:00:00 1970 +0000 - @@ -0,0 +1,1 @@ - +foo diff -r 68da5ae6e470 -r 3e24ce3de5f1 tests/test-hgweb-diffs.t --- a/tests/test-hgweb-diffs.t Sun May 13 22:59:22 2012 +0200 +++ b/tests/test-hgweb-diffs.t Tue May 15 07:00:55 2012 +0200 @@ -13,6 +13,7 @@ change permissions for git diffs $ chmod +x a + $ hg rm b $ hg ci -Amb set up hgweb @@ -90,7 +91,7 @@ children - 78e4ebad7cdf + 559edbd9ed20 files @@ -177,7 +178,7 @@ diff removed file - $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a' + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/b' 200 Script output follows @@ -188,7 +189,7 @@ - test: a diff + test: b diff @@ -199,23 +200,23 @@ mercurial