diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1905,7 +1905,7 @@ def clone(ui, source, dest=None, **opts) def commit(ui, repo, *pats, **opts): """commit changes in the queue repository (DEPRECATED) - This command is deprecated; use hg --mq commit instead.""" + This command is deprecated; use hg commit --mq instead.""" q = repo.mq r = q.qrepo() if not r: diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -164,10 +164,7 @@ def rebase(ui, repo, **opts): 'resolve then run hg rebase --continue')) updatedirstate(repo, rev, target, p2) if not collapsef: - extra = {'rebase_source': repo[rev].hex()} - if extrafn: - extrafn(repo[rev], extra) - newrev = concludenode(repo, rev, p1, p2, extra=extra) + newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn) else: # Skip commit if we are collapsing repo.dirstate.setparents(repo[p1].node()) @@ -193,7 +190,7 @@ def rebase(ui, repo, **opts): commitmsg += '\n* %s' % repo[rebased].description() commitmsg = ui.edit(commitmsg, repo.ui.username()) newrev = concludenode(repo, rev, p1, external, commitmsg=commitmsg, - extra=extrafn) + extrafn=extrafn) if 'qtip' in repo.tags(): updatemq(repo, state, skipped, **opts) @@ -269,17 +266,19 @@ def updatedirstate(repo, rev, p1, p2): if v in m2 and v not in m1: repo.dirstate.remove(v) -def concludenode(repo, rev, p1, p2, commitmsg=None, extra=None): +def concludenode(repo, rev, p1, p2, commitmsg=None, extrafn=None): 'Commit the changes and store useful information in extra' try: repo.dirstate.setparents(repo[p1].node(), repo[p2].node()) if commitmsg is None: commitmsg = repo[rev].description() - if extra is None: - extra = {} + ctx = repo[rev] + extra = {'rebase_source': ctx.hex()} + if extrafn: + extrafn(ctx, extra) # Commit might fail if unresolved files exist - newrev = repo.commit(text=commitmsg, user=repo[rev].user(), - date=repo[rev].date(), extra=extra) + newrev = repo.commit(text=commitmsg, user=ctx.user(), + date=ctx.date(), extra=extra) repo.dirstate.setbranch(repo[newrev].branch()) return newrev except util.Abort: diff --git a/mercurial/help/templates.txt b/mercurial/help/templates.txt --- a/mercurial/help/templates.txt +++ b/mercurial/help/templates.txt @@ -66,8 +66,9 @@ keywords are usually available for templ The "date" keyword does not produce human-readable output. If you want to use a date in your output, you can use a filter to process it. Filters are functions which return a string based on the input -variable. You can also use a chain of filters to get the desired -output:: +variable. Be sure to use the stringify filter first when you're +applying a string-input filter to a list-like input variable. +You can also use a chain of filters to get the desired output:: $ hg tip --template "{date|isodate}\n" 2008-08-21 18:22 +0000 diff --git a/mercurial/hgweb/wsgicgi.py b/mercurial/hgweb/wsgicgi.py --- a/mercurial/hgweb/wsgicgi.py +++ b/mercurial/hgweb/wsgicgi.py @@ -69,5 +69,9 @@ def launch(application): return write content = application(environ, start_response) - for chunk in content: - write(chunk) + try: + for chunk in content: + write(chunk) + finally: + if hasattr(content, 'close'): + content.close() diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -26,6 +26,12 @@ except: raise SystemExit( "Couldn't import standard zlib (incomplete Python install).") +try: + import bz2 +except: + raise SystemExit( + "Couldn't import standard bz2 (incomplete Python install).") + import os, subprocess, time import shutil import tempfile diff --git a/tests/test-convert-cvs b/tests/test-convert-cvs --- a/tests/test-convert-cvs +++ b/tests/test-convert-cvs @@ -80,7 +80,8 @@ cvscall -q -d "$CVSROOT" checkout -d src ls srcfull hg convert srcfull srcfull-hg \ | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' \ - | grep -v 'log entries' | grep -v 'hook:' + | grep -v 'log entries' | grep -v 'hook:' \ + | grep -v '^[0-3] .*' # filter instable changeset order hg cat -r tip srcfull-hg/src/a hg cat -r tip srcfull-hg/src/b/c diff --git a/tests/test-convert-cvs.out b/tests/test-convert-cvs.out --- a/tests/test-convert-cvs.out +++ b/tests/test-convert-cvs.out @@ -67,10 +67,6 @@ creating changesets 4 changeset entries sorting... converting... -3 Initial revision -2 import -1 initial checkin -0 ci0 updating tags a c diff --git a/tests/test-rebase-collapse b/tests/test-rebase-collapse --- a/tests/test-rebase-collapse +++ b/tests/test-rebase-collapse @@ -43,7 +43,7 @@ createrepo > /dev/null 2>&1 hg glog --template '{rev}: {desc}\n' echo '% Rebasing B onto H' hg up -C 3 -hg rebase --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/' +hg rebase --collapse --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/' hg glog --template '{rev}: {desc}\n' echo "Expected A, B, C, D, F, H" hg manifest