Mercurial > hg
changeset 23200:48a2eefd3d20
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 05 Nov 2014 12:41:12 -0600 |
parents | 20c4e7a994ac (diff) c35ffa4249ca (current diff) |
children | 7e97bf6ee2d6 |
files | |
diffstat | 87 files changed, 1560 insertions(+), 1352 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/Makefile.python Wed Nov 05 17:25:00 2014 +0000 +++ b/contrib/Makefile.python Wed Nov 05 12:41:12 2014 -0600 @@ -1,4 +1,4 @@ -PYTHONVER=2.7.6 +PYTHONVER=2.7.8 PYTHONNAME=python- PREFIX=$(HOME)/bin/prefix-$(PYTHONNAME)$(PYTHONVER) SYMLINKDIR=$(HOME)/bin @@ -27,7 +27,7 @@ # debian: apt-get install zlib1g-dev libbz2-dev libssl-dev @echo @echo 'To build a nice collection of interesting Python versions:' - @echo ' $$ for v in 2.{4{,.2,.3},5{,.6},6{,.1,.2,.9},7{,.6}}; do' + @echo ' $$ for v in 2.{4{,.2,.3},5{,.6},6{,.1,.2,.9},7{,.8}}; do' @echo ' make -f Makefile.python symlink PYTHONVER=$$v || break; done' @echo 'To run a Mercurial test on all these Python versions:' @echo ' $$ for py in `cd ~/bin && ls $(PYTHONNAME)2.*`; do' @@ -60,7 +60,7 @@ printf 'import sys, zlib, bz2\nif sys.version_info >= (2,6):\n import ssl' | $(PREFIX)/bin/python rm -rf $(PYTHON_SRCDIR) -DOCUTILSVER=0.11 +DOCUTILSVER=0.12 DOCUTILS_SRCDIR=docutils-$(DOCUTILSVER) DOCUTILS_SRCFILE=$(DOCUTILS_SRCDIR).tar.gz
--- a/contrib/buildrpm Wed Nov 05 17:25:00 2014 +0000 +++ b/contrib/buildrpm Wed Nov 05 12:41:12 2014 -0600 @@ -18,6 +18,7 @@ --withpython | --with-python) shift PYTHONVER=2.7.8 + PYTHONMD5=d4bca0159acb0b44a781292b5231936f ;; --rpmbuilddir ) shift @@ -76,11 +77,18 @@ cd build PYTHON_SRCFILE=Python-$PYTHONVER.tgz [ -f $PYTHON_SRCFILE ] || curl -Lo $PYTHON_SRCFILE http://www.python.org/ftp/python/$PYTHONVER/$PYTHON_SRCFILE + if [ "$PYTHONMD5" ]; then + echo "$PYTHONMD5 $PYTHON_SRCFILE" | md5sum -w -c + fi ln -f $PYTHON_SRCFILE $RPMBUILDDIR/SOURCES/$PYTHON_SRCFILE DOCUTILSVER=`sed -ne "s/^%global docutilsname docutils-//p" $specfile` DOCUTILS_SRCFILE=docutils-$DOCUTILSVER.tar.gz [ -f $DOCUTILS_SRCFILE ] || curl -Lo $DOCUTILS_SRCFILE http://downloads.sourceforge.net/project/docutils/docutils/$DOCUTILSVER/$DOCUTILS_SRCFILE + DOCUTILSMD5=`sed -ne "s/^%global docutilsmd5 //p" $specfile` + if [ "$DOCUTILSMD5" ]; then + echo "$DOCUTILSMD5 $DOCUTILS_SRCFILE" | md5sum -w -c + fi ln -f $DOCUTILS_SRCFILE $RPMBUILDDIR/SOURCES/$DOCUTILS_SRCFILE ) fi
--- a/contrib/check-code.py Wed Nov 05 17:25:00 2014 +0000 +++ b/contrib/check-code.py Wed Nov 05 12:41:12 2014 -0600 @@ -94,7 +94,7 @@ (r'sed.*-i', "don't use 'sed -i', use a temporary file"), (r'\becho\b.*\\n', "don't use 'echo \\n', use printf"), (r'echo -n', "don't use 'echo -n', use printf"), - (r'(^| )\bwc\b[^|]*$\n(?!.*\(re\))', "filter wc output"), + (r'(^|\|\s*)\bwc\b[^|]*$\n(?!.*\(re\))', "filter wc output"), (r'head -c', "don't use 'head -c', use 'dd'"), (r'tail -n', "don't use the '-n' option to tail, just use '-<num>'"), (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"), @@ -291,7 +291,7 @@ "always assign an opened file to a variable, and close it afterwards"), (r'[\s\(](open|file)\([^)]*\)\.', "always assign an opened file to a variable, and close it afterwards"), - (r'(?i)descendent', "the proper spelling is descendAnt"), + (r'(?i)descend[e]nt', "the proper spelling is descendAnt"), (r'\.debug\(\_', "don't mark debug messages for translation"), (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"), (r'^\s*except\s*:', "naked except clause", r'#.*re-raises'),
--- a/contrib/mercurial.spec Wed Nov 05 17:25:00 2014 +0000 +++ b/contrib/mercurial.spec Wed Nov 05 12:41:12 2014 -0600 @@ -6,7 +6,8 @@ %global pythonver %{withpython} %global pythonname Python-%{withpython} -%global docutilsname docutils-0.11 +%global docutilsname docutils-0.12 +%global docutilsmd5 4622263b62c5c771c03502afa3157768 %global pythonhg python-hg %global hgpyprefix /usr/%{pythonhg} # byte compilation will fail on some some Python /test/ files @@ -126,7 +127,6 @@ install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}/ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d -install -m 644 contrib/mergetools.hgrc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/mergetools.rc %clean rm -rf $RPM_BUILD_ROOT @@ -149,7 +149,6 @@ %config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh %dir %{_sysconfdir}/mercurial %dir %{_sysconfdir}/mercurial/hgrc.d -%config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/mergetools.rc %if "%{?withpython}" %{_bindir}/%{pythonhg} %{hgpyprefix}
--- a/contrib/mergetools.hgrc Wed Nov 05 17:25:00 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -# Some default global settings for common merge tools - -[merge-tools] -kdiff3.args=--auto --L1 base --L2 local --L3 other $base $local $other -o $output -kdiff3.regkey=Software\KDiff3 -kdiff3.regkeyalt=Software\Wow6432Node\KDiff3 -kdiff3.regappend=\kdiff3.exe -kdiff3.fixeol=True -kdiff3.gui=True -kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child - -gvimdiff.args=--nofork -d -g -O $local $other $base -gvimdiff.regkey=Software\Vim\GVim -gvimdiff.regkeyalt=Software\Wow6432Node\Vim\GVim -gvimdiff.regname=path -gvimdiff.priority=-9 -gvimdiff.diffargs=--nofork -d -g -O $parent $child - -vimdiff.args=$local $other $base -c 'redraw | echomsg "hg merge conflict, type \":cq\" to abort vimdiff"' -vimdiff.check=changed -vimdiff.priority=-10 - -merge.check=conflicts -merge.priority=-100 - -gpyfm.gui=True - -meld.gui=True -meld.args=--label='local' $local --label='merged' $base --label='other' $other -o $output -meld.check=changed -meld.diffargs=-a --label='$plabel1' $parent --label='$clabel' $child - -tkdiff.args=$local $other -a $base -o $output -tkdiff.gui=True -tkdiff.priority=-8 -tkdiff.diffargs=-L '$plabel1' $parent -L '$clabel' $child - -xxdiff.args=--show-merged-pane --exit-with-merge-status --title1 local --title2 base --title3 other --merged-filename $output --merge $local $base $other -xxdiff.gui=True -xxdiff.priority=-8 -xxdiff.diffargs=--title1 '$plabel1' $parent --title2 '$clabel' $child - -diffmerge.regkey=Software\SourceGear\SourceGear DiffMerge\ -diffmerge.regkeyalt=Software\Wow6432Node\SourceGear\SourceGear DiffMerge\ -diffmerge.regname=Location -diffmerge.priority=-7 -diffmerge.args=-nosplash -merge -title1=local -title2=merged -title3=other $local $base $other -result=$output -diffmerge.check=changed -diffmerge.gui=True -diffmerge.diffargs=--nosplash --title1='$plabel1' --title2='$clabel' $parent $child - -p4merge.args=$base $local $other $output -p4merge.regkey=Software\Perforce\Environment -p4merge.regkeyalt=Software\Wow6432Node\Perforce\Environment -p4merge.regname=P4INSTROOT -p4merge.regappend=\p4merge.exe -p4merge.gui=True -p4merge.priority=-8 -p4merge.diffargs=$parent $child - -p4mergeosx.executable = /Applications/p4merge.app/Contents/MacOS/p4merge -p4mergeosx.args = $base $local $other $output -p4mergeosx.gui = True -p4mergeosx.priority=-8 -p4mergeosx.diffargs=$parent $child - -tortoisemerge.args=/base:$base /mine:$local /theirs:$other /merged:$output -tortoisemerge.regkey=Software\TortoiseSVN -tortoisemerge.regkeyalt=Software\Wow6432Node\TortoiseSVN -tortoisemerge.check=changed -tortoisemerge.gui=True -tortoisemerge.priority=-8 -tortoisemerge.diffargs=/base:$parent /mine:$child /basename:'$plabel1' /minename:'$clabel' - -ecmerge.args=$base $local $other --mode=merge3 --title0=base --title1=local --title2=other --to=$output -ecmerge.regkey=Software\Elli\xc3\xa9 Computing\Merge -ecmerge.regkeyalt=Software\Wow6432Node\Elli\xc3\xa9 Computing\Merge -ecmerge.gui=True -ecmerge.diffargs=$parent $child --mode=diff2 --title1='$plabel1' --title2='$clabel' - -# editmerge is a small script shipped in contrib. -# It needs this config otherwise it behaves the same as internal:local -editmerge.args=$output -editmerge.check=changed -editmerge.premerge=keep - -filemerge.executable=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge -filemerge.args=-left $other -right $local -ancestor $base -merge $output -filemerge.gui=True - -; Windows version of Beyond Compare -beyondcompare3.args=$local $other $base $output /ro /lefttitle=local /centertitle=base /righttitle=other /automerge /reviewconflicts /solo -beyondcompare3.regkey=Software\Scooter Software\Beyond Compare 3 -beyondcompare3.regname=ExePath -beyondcompare3.gui=True -beyondcompare3.priority=-2 -beyondcompare3.diffargs=/lro /lefttitle='$plabel1' /righttitle='$clabel' /solo /expandall $parent $child - -; Linux version of Beyond Compare -bcompare.args=$local $other $base -mergeoutput=$output -ro -lefttitle=parent1 -centertitle=base -righttitle=parent2 -outputtitle=merged -automerge -reviewconflicts -solo -bcompare.gui=True -bcompare.priority=-1 -bcompare.diffargs=-lro -lefttitle='$plabel1' -righttitle='$clabel' -solo -expandall $parent $child - -winmerge.args=/e /x /wl /ub /dl other /dr local $other $local $output -winmerge.regkey=Software\Thingamahoochie\WinMerge -winmerge.regkeyalt=Software\Wow6432Node\Thingamahoochie\WinMerge\ -winmerge.regname=Executable -winmerge.check=changed -winmerge.gui=True -winmerge.priority=-10 -winmerge.diffargs=/r /e /x /ub /wl /dl '$plabel1' /dr '$clabel' $parent $child - -araxis.regkey=SOFTWARE\Classes\TypeLib\{46799e0a-7bd1-4330-911c-9660bb964ea2}\7.0\HELPDIR -araxis.regappend=\ConsoleCompare.exe -araxis.priority=-2 -araxis.args=/3 /a2 /wait /merge /title1:"Other" /title2:"Base" /title3:"Local :"$local $other $base $local $output -araxis.checkconflict=True -araxis.binary=True -araxis.gui=True -araxis.diffargs=/2 /wait /title1:"$plabel1" /title2:"$clabel" $parent $child - -diffuse.priority=-3 -diffuse.args=$local $base $other -diffuse.gui=True -diffuse.diffargs=$parent $child - -UltraCompare.regkey=Software\Microsoft\Windows\CurrentVersion\App Paths\UC.exe -UltraCompare.regkeyalt=Software\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\UC.exe -UltraCompare.args = $base $local $other -title1 base -title3 other -UltraCompare.priority = -2 -UltraCompare.gui = True -UltraCompare.binary = True -UltraCompare.check = conflicts,changed -UltraCompare.diffargs=$child $parent -title1 $clabel -title2 $plabel1
--- a/contrib/perf.py Wed Nov 05 17:25:00 2014 +0000 +++ b/contrib/perf.py Wed Nov 05 12:41:12 2014 -0600 @@ -4,11 +4,26 @@ from mercurial import cmdutil, scmutil, util, commands, obsolete from mercurial import repoview, branchmap, merge, copies import time, os, sys +import functools cmdtable = {} command = cmdutil.command(cmdtable) -def timer(func, title=None): +def gettimer(ui, opts=None): + """return a timer function and formatter: (timer, formatter) + + This functions exist to gather the creation of formatter in a single + place instead of duplicating it in all performance command.""" + if opts is None: + opts = {} + # redirect all to stderr + ui = ui.copy() + ui.fout = ui.ferr + # get a formatter + fm = ui.formatter('perf', opts) + return functools.partial(_timer, fm), fm + +def _timer(fm, func, title=None): results = [] begin = time.time() count = 0 @@ -25,16 +40,25 @@ break if cstop - begin > 10 and count >= 3: break + + fm.startitem() + if title: - sys.stderr.write("! %s\n" % title) + fm.write('title', '! %s\n', title) if r: - sys.stderr.write("! result: %s\n" % r) + fm.write('result', '! result: %s\n', r) m = min(results) - sys.stderr.write("! wall %f comb %f user %f sys %f (best of %d)\n" - % (m[0], m[1] + m[2], m[1], m[2], count)) + fm.plain('!') + fm.write('wall', ' wall %f', m[0]) + fm.write('comb', ' comb %f', m[1] + m[2]) + fm.write('user', ' user %f', m[1]) + fm.write('sys', ' sys %f', m[2]) + fm.write('count', ' (best of %d)', count) + fm.plain('\n') @command('perfwalk') def perfwalk(ui, repo, *pats): + timer, fm = gettimer(ui) try: m = scmutil.match(repo[None], pats, {}) timer(lambda: len(list(repo.dirstate.walk(m, [], True, False)))) @@ -44,11 +68,14 @@ timer(lambda: len([b for a, b, c in repo.dirstate.statwalk([], m)])) except Exception: timer(lambda: len(list(cmdutil.walk(repo, pats, {})))) + fm.end() @command('perfannotate') def perfannotate(ui, repo, f): + timer, fm = gettimer(ui) fc = repo['.'][f] timer(lambda: len(fc.annotate(True))) + fm.end() @command('perfstatus', [('u', 'unknown', False, @@ -57,16 +84,20 @@ #m = match.always(repo.root, repo.getcwd()) #timer(lambda: sum(map(len, repo.dirstate.status(m, [], False, False, # False)))) + timer, fm = gettimer(ui) timer(lambda: sum(map(len, repo.status(**opts)))) + fm.end() @command('perfaddremove') def perfaddremove(ui, repo): + timer, fm = gettimer(ui) try: oldquiet = repo.ui.quiet repo.ui.quiet = True timer(lambda: scmutil.addremove(repo, dry_run=True)) finally: repo.ui.quiet = oldquiet + fm.end() def clearcaches(cl): # behave somewhat consistently across internal API changes @@ -79,33 +110,40 @@ @command('perfheads') def perfheads(ui, repo): + timer, fm = gettimer(ui) cl = repo.changelog def d(): len(cl.headrevs()) clearcaches(cl) timer(d) + fm.end() @command('perftags') def perftags(ui, repo): import mercurial.changelog import mercurial.manifest + timer, fm = gettimer(ui) def t(): repo.changelog = mercurial.changelog.changelog(repo.sopener) repo.manifest = mercurial.manifest.manifest(repo.sopener) repo._tags = None return len(repo.tags()) timer(t) + fm.end() @command('perfancestors') def perfancestors(ui, repo): + timer, fm = gettimer(ui) heads = repo.changelog.headrevs() def d(): for a in repo.changelog.ancestors(heads): pass timer(d) + fm.end() @command('perfancestorset') def perfancestorset(ui, repo, revset): + timer, fm = gettimer(ui) revs = repo.revs(revset) heads = repo.changelog.headrevs() def d(): @@ -113,34 +151,42 @@ for rev in revs: rev in s timer(d) + fm.end() @command('perfdirs') def perfdirs(ui, repo): + timer, fm = gettimer(ui) dirstate = repo.dirstate 'a' in dirstate def d(): dirstate.dirs() del dirstate._dirs timer(d) + fm.end() @command('perfdirstate') def perfdirstate(ui, repo): + timer, fm = gettimer(ui) "a" in repo.dirstate def d(): repo.dirstate.invalidate() "a" in repo.dirstate timer(d) + fm.end() @command('perfdirstatedirs') def perfdirstatedirs(ui, repo): + timer, fm = gettimer(ui) "a" in repo.dirstate def d(): "a" in repo.dirstate._dirs del repo.dirstate._dirs timer(d) + fm.end() @command('perfdirstatefoldmap') def perffoldmap(ui, repo): + timer, fm = gettimer(ui) dirstate = repo.dirstate 'a' in dirstate def d(): @@ -148,19 +194,23 @@ del dirstate._foldmap del dirstate._dirs timer(d) + fm.end() @command('perfdirstatewrite') def perfdirstatewrite(ui, repo): + timer, fm = gettimer(ui) ds = repo.dirstate "a" in ds def d(): ds._dirty = True ds.write() timer(d) + fm.end() @command('perfmergecalculate', [('r', 'rev', '.', 'rev to merge against')]) def perfmergecalculate(ui, repo, rev): + timer, fm = gettimer(ui) wctx = repo[None] rctx = scmutil.revsingle(repo, rev, rev) ancestor = wctx.ancestor(rctx) @@ -173,17 +223,21 @@ merge.calculateupdates(repo, wctx, rctx, ancestor, False, False, False, acceptremote=True) timer(d) + fm.end() @command('perfpathcopies', [], "REV REV") def perfpathcopies(ui, repo, rev1, rev2): + timer, fm = gettimer(ui) ctx1 = scmutil.revsingle(repo, rev1, rev1) ctx2 = scmutil.revsingle(repo, rev2, rev2) def d(): copies.pathcopies(ctx1, ctx2) timer(d) + fm.end() @command('perfmanifest', [], 'REV') def perfmanifest(ui, repo, rev): + timer, fm = gettimer(ui) ctx = scmutil.revsingle(repo, rev, rev) t = ctx.manifestnode() def d(): @@ -191,51 +245,65 @@ repo.manifest._cache = None repo.manifest.read(t) timer(d) + fm.end() @command('perfchangeset') def perfchangeset(ui, repo, rev): + timer, fm = gettimer(ui) n = repo[rev].node() def d(): repo.changelog.read(n) #repo.changelog._cache = None timer(d) + fm.end() @command('perfindex') def perfindex(ui, repo): import mercurial.revlog + timer, fm = gettimer(ui) mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg n = repo["tip"].node() def d(): cl = mercurial.revlog.revlog(repo.sopener, "00changelog.i") cl.rev(n) timer(d) + fm.end() @command('perfstartup') def perfstartup(ui, repo): + timer, fm = gettimer(ui) cmd = sys.argv[0] def d(): os.system("HGRCPATH= %s version -q > /dev/null" % cmd) timer(d) + fm.end() @command('perfparents') def perfparents(ui, repo): + timer, fm = gettimer(ui) nl = [repo.changelog.node(i) for i in xrange(1000)] def d(): for n in nl: repo.changelog.parents(n) timer(d) + fm.end() @command('perflookup') def perflookup(ui, repo, rev): + timer, fm = gettimer(ui) timer(lambda: len(repo.lookup(rev))) + fm.end() @command('perfrevrange') def perfrevrange(ui, repo, *specs): + timer, fm = gettimer(ui) revrange = scmutil.revrange timer(lambda: len(revrange(repo, specs))) + fm.end() @command('perfnodelookup') def perfnodelookup(ui, repo, rev): + timer, fm = gettimer(ui) import mercurial.revlog mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg n = repo[rev].node() @@ -244,14 +312,17 @@ cl.rev(n) clearcaches(cl) timer(d) + fm.end() @command('perflog', [('', 'rename', False, 'ask log to follow renames')]) def perflog(ui, repo, **opts): + timer, fm = gettimer(ui) ui.pushbuffer() timer(lambda: commands.log(ui, repo, rev=[], date='', user='', copies=opts.get('rename'))) ui.popbuffer() + fm.end() @command('perfmoonwalk') def perfmoonwalk(ui, repo): @@ -259,52 +330,65 @@ This also loads the changelog data for each revision in the changelog. """ + timer, fm = gettimer(ui) def moonwalk(): for i in xrange(len(repo), -1, -1): ctx = repo[i] ctx.branch() # read changelog data (in addition to the index) timer(moonwalk) + fm.end() @command('perftemplating') def perftemplating(ui, repo): + timer, fm = gettimer(ui) ui.pushbuffer() timer(lambda: commands.log(ui, repo, rev=[], date='', user='', template='{date|shortdate} [{rev}:{node|short}]' ' {author|person}: {desc|firstline}\n')) ui.popbuffer() + fm.end() @command('perfcca') def perfcca(ui, repo): + timer, fm = gettimer(ui) timer(lambda: scmutil.casecollisionauditor(ui, False, repo.dirstate)) + fm.end() @command('perffncacheload') def perffncacheload(ui, repo): + timer, fm = gettimer(ui) s = repo.store def d(): s.fncache._load() timer(d) + fm.end() @command('perffncachewrite') def perffncachewrite(ui, repo): + timer, fm = gettimer(ui) s = repo.store s.fncache._load() def d(): s.fncache._dirty = True s.fncache.write() timer(d) + fm.end() @command('perffncacheencode') def perffncacheencode(ui, repo): + timer, fm = gettimer(ui) s = repo.store s.fncache._load() def d(): for p in s.fncache.entries: s.encode(p) timer(d) + fm.end() @command('perfdiffwd') def perfdiffwd(ui, repo): """Profile diff of working directory changes""" + timer, fm = gettimer(ui) options = { 'w': 'ignore_all_space', 'b': 'ignore_space_change', @@ -319,11 +403,13 @@ ui.popbuffer() title = 'diffopts: %s' % (diffopt and ('-' + diffopt) or 'none') timer(d, title) + fm.end() @command('perfrevlog', [('d', 'dist', 100, 'distance between the revisions')], "[INDEXFILE]") def perfrevlog(ui, repo, file_, **opts): + timer, fm = gettimer(ui) from mercurial import revlog dist = opts['dist'] def d(): @@ -332,6 +418,7 @@ r.revision(r.node(x)) timer(d) + fm.end() @command('perfrevset', [('C', 'clear', False, 'clear volatile cache between each call.')], @@ -342,17 +429,20 @@ Use the --clean option if need to evaluate the impact of build volatile revisions set cache on the revset execution. Volatile cache hold filtered and obsolete related cache.""" + timer, fm = gettimer(ui) def d(): if clear: repo.invalidatevolatilesets() for r in repo.revs(expr): pass timer(d) + fm.end() @command('perfvolatilesets') def perfvolatilesets(ui, repo, *names): """benchmark the computation of various volatile set Volatile set computes element related to filtering and obsolescence.""" + timer, fm = gettimer(ui) repo = repo.unfiltered() def getobs(name): @@ -380,6 +470,7 @@ for name in allfilter: timer(getfiltered(name), title=name) + fm.end() @command('perfbranchmap', [('f', 'full', False, @@ -390,6 +481,7 @@ This benchmarks the full repo.branchmap() call with read and write disabled """ + timer, fm = gettimer(ui) def getbranchmap(filtername): """generate a benchmark function for the filtername""" if filtername is None: @@ -432,3 +524,4 @@ finally: branchmap.read = oldread branchmap.branchcache.write = oldwrite + fm.end()
--- a/contrib/revsetbenchmarks.py Wed Nov 05 17:25:00 2014 +0000 +++ b/contrib/revsetbenchmarks.py Wed Nov 05 12:41:12 2014 -0600 @@ -74,7 +74,7 @@ parser = OptionParser(usage="usage: %prog [options] <revs>") parser.add_option("-f", "--file", - help="read revset from FILE (stdin if omited)", + help="read revset from FILE (stdin if omitted)", metavar="FILE") parser.add_option("-R", "--repo", help="run benchmark on REPO", metavar="REPO")
--- a/contrib/win32/mercurial.iss Wed Nov 05 17:25:00 2014 +0000 +++ b/contrib/win32/mercurial.iss Wed Nov 05 12:41:12 2014 -0600 @@ -67,8 +67,6 @@ Source: contrib\hgweb.fcgi; DestDir: {app}/Contrib Source: contrib\hgweb.wsgi; DestDir: {app}/Contrib Source: contrib\win32\ReadMe.html; DestDir: {app}; Flags: isreadme -Source: contrib\mergetools.hgrc; DestDir: {tmp}; -Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName: Mercurial.ini; Check: CheckFile; AfterInstall: ConcatenateFiles; Source: contrib\win32\postinstall.txt; DestDir: {app}; DestName: ReleaseNotes.txt Source: dist\hg.exe; DestDir: {app}; AfterInstall: Touch('{app}\hg.exe.local') #if ARCH == "x64" @@ -86,6 +84,7 @@ Source: doc\*.html; DestDir: {app}\Docs Source: doc\style.css; DestDir: {app}\Docs Source: mercurial\help\*.txt; DestDir: {app}\help +Source: mercurial\default.d\*.rc; DestDir: {app}\default.d Source: mercurial\locale\*.*; DestDir: {app}\locale; Flags: recursesubdirs createallsubdirs skipifsourcedoesntexist Source: mercurial\templates\*.*; DestDir: {app}\Templates; Flags: recursesubdirs createallsubdirs Source: CONTRIBUTORS; DestDir: {app}; DestName: Contributors.txt @@ -93,10 +92,13 @@ [INI] Filename: {app}\Mercurial.url; Section: InternetShortcut; Key: URL; String: http://mercurial.selenic.com/ -Filename: {app}\Mercurial.ini; Section: web; Key: cacerts; String: {app}\cacert.pem +Filename: {app}\default.d\editor.rc; Section: ui; Key: editor; String: notepad +Filename: {app}\default.d\cacerts.rc; Section: web; Key: cacerts; String: {app}\cacert.pem [UninstallDelete] Type: files; Name: {app}\Mercurial.url +Type: filesandordirs; Name: {app}\default.d +Type: files; Name: "{app}\hg.exe.local" [Icons] Name: {group}\Uninstall Mercurial; Filename: {uninstallexe} @@ -111,35 +113,7 @@ [UninstallRun] Filename: "{app}\add_path.exe"; Parameters: "/del {app}" -[UninstallDelete] -Type: files; Name: "{app}\hg.exe.local" - [Code] -var - WriteFile: Boolean; - CheckDone: Boolean; - -function CheckFile(): Boolean; -begin - if not CheckDone then begin - WriteFile := True; - if FileExists(ExpandConstant(CurrentFileName)) then begin - WriteFile := MsgBox('' + ExpandConstant(CurrentFileName) + '' #13#13 'The file already exists.' #13#13 'Would you like Setup to overwrite it?', mbConfirmation, MB_YESNO) = idYes; - end; - CheckDone := True; - end; - Result := WriteFile; -end; - -procedure ConcatenateFiles(); -var - MergeConfigs: TArrayOfString; -begin - if LoadStringsFromFile(ExpandConstant('{tmp}\mergetools.hgrc'),MergeConfigs) then begin - SaveStringsToFile(ExpandConstant(CurrentFileName),MergeConfigs,True); - end; -end; - procedure Touch(fn: String); begin SaveStringToFile(ExpandConstant(fn), '', False);
--- a/contrib/wix/mercurial.wxs Wed Nov 05 17:25:00 2014 +0000 +++ b/contrib/wix/mercurial.wxs Wed Nov 05 12:41:12 2014 -0600 @@ -79,7 +79,7 @@ ReadOnly='yes' KeyPath='yes'/> </Component> <Component Id='mergetools.rc' Guid='$(var.mergetools.rc.guid)' Win64='$(var.IsX64)'> - <File Id='mergetools.rc' Name='MergeTools.rc' Source='contrib\mergetools.hgrc' + <File Id='mergetools.rc' Name='MergeTools.rc' Source='mercurial\default.d\mergetools.rc' ReadOnly='yes' KeyPath='yes'/> </Component> <Component Id='paths.rc' Guid='$(var.paths.rc.guid)' Win64='$(var.IsX64)'>
--- a/hgext/color.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/color.py Wed Nov 05 12:41:12 2014 -0600 @@ -301,6 +301,11 @@ 'histedit.remaining': 'red bold', 'ui.prompt': 'yellow', 'log.changeset': 'yellow', + 'patchbomb.finalsummary': '', + 'patchbomb.from': 'magenta', + 'patchbomb.to': 'cyan', + 'patchbomb.subject': 'green', + 'patchbomb.diffstats': '', 'rebase.rebased': 'blue', 'rebase.remaining': 'red bold', 'resolve.resolved': 'green bold',
--- a/hgext/extdiff.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/extdiff.py Wed Nov 05 12:41:12 2014 -0600 @@ -23,10 +23,9 @@ #cmd.cdiff = gdiff #opts.cdiff = -Nprc5 - # add new command called vdiff, runs kdiff3 - vdiff = kdiff3 - - # add new command called meld, runs meld (no need to name twice) + # add new command called meld, runs meld (no need to name twice). If + # the meld executable is not available, the meld tool in [merge-tools] + # will be used, if available meld = # add new command called vimdiff, runs gvimdiff with DirDiff plugin @@ -63,7 +62,7 @@ from mercurial.i18n import _ from mercurial.node import short, nullid -from mercurial import cmdutil, scmutil, util, commands, encoding +from mercurial import cmdutil, scmutil, util, commands, encoding, filemerge import os, shlex, shutil, tempfile, re cmdtable = {} @@ -90,7 +89,7 @@ wopener = scmutil.opener(base) fns_and_mtime = [] ctx = repo[node] - for fn in files: + for fn in sorted(files): wfn = util.pconvert(fn) if wfn not in ctx: # File doesn't exist; could be a bogus modify @@ -279,7 +278,9 @@ if cmd.startswith('cmd.'): cmd = cmd[4:] if not path: - path = cmd + path = util.findexe(cmd) + if path is None: + path = filemerge.findexternaltool(ui, cmd) or cmd diffopts = shlex.split(ui.config('extdiff', 'opts.' + cmd, '')) elif cmd.startswith('opts.'): continue @@ -289,7 +290,9 @@ diffopts = shlex.split(path) path = diffopts.pop(0) else: - path, diffopts = cmd, [] + path, diffopts = util.findexe(cmd), [] + if path is None: + path = filemerge.findexternaltool(ui, cmd) or cmd # look for diff arguments in [diff-tools] then [merge-tools] if diffopts == []: args = ui.config('diff-tools', cmd+'.diffargs') or \
--- a/hgext/largefiles/lfcommands.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/largefiles/lfcommands.py Wed Nov 05 12:41:12 2014 -0600 @@ -435,8 +435,14 @@ ui.status(_("%d largefiles failed to download\n") % totalmissing) return totalsuccess, totalmissing -def updatelfiles(ui, repo, filelist=None, printmessage=True, +def updatelfiles(ui, repo, filelist=None, printmessage=None, normallookup=False): + '''Update largefiles according to standins in the working directory + + If ``printmessage`` is other than ``None``, it means "print (or + ignore, for false) message forcibly". + ''' + statuswriter = lfutil.getstatuswriter(ui, repo, printmessage) wlock = repo.wlock() try: lfdirstate = lfutil.openlfdirstate(ui, repo) @@ -462,10 +468,10 @@ expecthash != lfutil.hashfile(abslfile))): if lfile not in repo[None]: # not switched to normal file util.unlinkpath(abslfile, ignoremissing=True) - # use normallookup() to allocate entry in largefiles + # use normallookup() to allocate an entry in largefiles # dirstate, because lack of it misleads # lfilesrepo.status() into recognition that such cache - # missing files are REMOVED. + # missing files are removed. lfdirstate.normallookup(lfile) update[lfile] = expecthash else: @@ -482,8 +488,7 @@ lfdirstate.write() if lfiles: - if printmessage: - ui.status(_('getting changed largefiles\n')) + statuswriter(_('getting changed largefiles\n')) cachelfiles(ui, repo, None, lfiles) for lfile in lfiles: @@ -527,8 +532,8 @@ lfutil.synclfdirstate(repo, lfdirstate, lfile, True) lfdirstate.write() - if printmessage and lfiles: - ui.status(_('%d largefiles updated, %d removed\n') % (updated, + if lfiles: + statuswriter(_('%d largefiles updated, %d removed\n') % (updated, removed)) finally: wlock.release()
--- a/hgext/largefiles/lfutil.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/largefiles/lfutil.py Wed Nov 05 12:41:12 2014 -0600 @@ -12,6 +12,7 @@ import platform import shutil import stat +import copy from mercurial import dirstate, httpconnection, match as match_, util, scmutil from mercurial.i18n import _ @@ -386,6 +387,18 @@ elif state == '?': lfdirstate.drop(lfile) +def markcommitted(orig, ctx, node): + repo = ctx._repo + + orig(node) + + lfdirstate = openlfdirstate(repo.ui, repo) + for f in ctx.files(): + if isstandin(f): + lfile = splitstandin(f) + synclfdirstate(repo, lfdirstate, lfile, False) + lfdirstate.write() + def getlfilestoupdate(oldstandins, newstandins): changedstandins = set(oldstandins).symmetric_difference(set(newstandins)) filelist = [] @@ -415,3 +428,149 @@ for fn in files: if isstandin(fn) and fn in ctx: addfunc(fn, ctx[fn].data().strip()) + +def updatestandinsbymatch(repo, match): + '''Update standins in the working directory according to specified match + + This returns (possibly modified) ``match`` object to be used for + subsequent commit process. + ''' + + ui = repo.ui + + # Case 0: Automated committing + # + # While automated committing (like rebase, transplant + # and so on), this code path is used to avoid: + # (1) updating standins, because standins should + # be already updated at this point + # (2) aborting when standins are matched by "match", + # because automated committing may specify them directly + # + if getattr(repo, "_istransplanting", False): + return match + + # Case 1: user calls commit with no specific files or + # include/exclude patterns: refresh and commit all files that + # are "dirty". + if match is None or match.always(): + # Spend a bit of time here to get a list of files we know + # are modified so we can compare only against those. + # It can cost a lot of time (several seconds) + # otherwise to update all standins if the largefiles are + # large. + lfdirstate = openlfdirstate(ui, repo) + dirtymatch = match_.always(repo.root, repo.getcwd()) + unsure, s = lfdirstate.status(dirtymatch, [], False, False, + False) + modifiedfiles = unsure + s.modified + s.added + s.removed + lfiles = listlfiles(repo) + # this only loops through largefiles that exist (not + # removed/renamed) + for lfile in lfiles: + if lfile in modifiedfiles: + if os.path.exists( + repo.wjoin(standin(lfile))): + # this handles the case where a rebase is being + # performed and the working copy is not updated + # yet. + if os.path.exists(repo.wjoin(lfile)): + updatestandin(repo, + standin(lfile)) + + return match + + lfiles = listlfiles(repo) + match._files = repo._subdirlfs(match.files(), lfiles) + + # Case 2: user calls commit with specified patterns: refresh + # any matching big files. + smatcher = composestandinmatcher(repo, match) + standins = repo.dirstate.walk(smatcher, [], False, False) + + # No matching big files: get out of the way and pass control to + # the usual commit() method. + if not standins: + return match + + # Refresh all matching big files. It's possible that the + # commit will end up failing, in which case the big files will + # stay refreshed. No harm done: the user modified them and + # asked to commit them, so sooner or later we're going to + # refresh the standins. Might as well leave them refreshed. + lfdirstate = openlfdirstate(ui, repo) + for fstandin in standins: + lfile = splitstandin(fstandin) + if lfdirstate[lfile] != 'r': + updatestandin(repo, fstandin) + + # Cook up a new matcher that only matches regular files or + # standins corresponding to the big files requested by the + # user. Have to modify _files to prevent commit() from + # complaining "not tracked" for big files. + match = copy.copy(match) + origmatchfn = match.matchfn + + # Check both the list of largefiles and the list of + # standins because if a largefile was removed, it + # won't be in the list of largefiles at this point + match._files += sorted(standins) + + actualfiles = [] + for f in match._files: + fstandin = standin(f) + + # ignore known largefiles and standins + if f in lfiles or fstandin in standins: + continue + + actualfiles.append(f) + match._files = actualfiles + + def matchfn(f): + if origmatchfn(f): + return f not in lfiles + else: + return f in standins + + match.matchfn = matchfn + + return match + +class automatedcommithook(object): + '''Statefull hook to update standins at the 1st commit of resuming + + For efficiency, updating standins in the working directory should + be avoided while automated committing (like rebase, transplant and + so on), because they should be updated before committing. + + But the 1st commit of resuming automated committing (e.g. ``rebase + --continue``) should update them, because largefiles may be + modified manually. + ''' + def __init__(self, resuming): + self.resuming = resuming + + def __call__(self, repo, match): + if self.resuming: + self.resuming = False # avoids updating at subsequent commits + return updatestandinsbymatch(repo, match) + else: + return match + +def getstatuswriter(ui, repo, forcibly=None): + '''Return the function to write largefiles specific status out + + If ``forcibly`` is ``None``, this returns the last element of + ``repo._lfupdatereporters`` as "default" writer function. + + Otherwise, this returns the function to always write out (or + ignore if ``not forcibly``) status. + ''' + if forcibly is None: + return repo._lfstatuswriters[-1] + else: + if forcibly: + return ui.status # forcibly WRITE OUT + else: + return lambda *msg, **opts: None # forcibly IGNORE
--- a/hgext/largefiles/overrides.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/largefiles/overrides.py Wed Nov 05 12:41:12 2014 -0600 @@ -11,11 +11,10 @@ import os import copy -from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \ +from mercurial import hg, util, cmdutil, scmutil, match as match_, \ archival, pathutil, revset from mercurial.i18n import _ from mercurial.node import hex -from hgext import rebase import lfutil import lfcommands @@ -35,7 +34,7 @@ m._fmap = set(m._files) m._always = False origmatchfn = m.matchfn - m.matchfn = lambda f: notlfile(f) and origmatchfn(f) or None + m.matchfn = lambda f: notlfile(f) and origmatchfn(f) return m oldmatch = installmatchfn(overridematch) @@ -63,10 +62,10 @@ def restorematchandpatsfn(): '''restores scmutil.matchandpats to what it was before - installnormalfilesmatchandpatsfn was called. no-op if scmutil.matchandpats + installmatchandpatsfn was called. No-op if scmutil.matchandpats is its original function. - Note that n calls to installnormalfilesmatchandpatsfn will require n calls + Note that n calls to installmatchandpatsfn will require n calls to restore matchfn to reverse''' scmutil.matchandpats = getattr(scmutil.matchandpats, 'oldmatchandpats', scmutil.matchandpats) @@ -576,7 +575,6 @@ lfile = lambda f: lfutil.standin(f) in manifest m._files = [lfutil.standin(f) for f in m._files if lfile(f)] m._fmap = set(m._files) - m._always = False origmatchfn = m.matchfn m.matchfn = lambda f: (lfutil.isstandin(f) and (f in manifest) and @@ -684,7 +682,6 @@ m._files = [tostandin(f) for f in m._files] m._files = [f for f in m._files if f is not None] m._fmap = set(m._files) - m._always = False origmatchfn = m.matchfn def matchfn(f): if lfutil.isstandin(f): @@ -712,37 +709,14 @@ finally: wlock.release() -# When we rebase a repository with remotely changed largefiles, we need to -# take some extra care so that the largefiles are correctly updated in the -# working copy +# after pulling changesets, we need to take some extra care to get +# largefiles updated remotely def overridepull(orig, ui, repo, source=None, **opts): revsprepull = len(repo) if not source: source = 'default' repo.lfpullsource = source - if opts.get('rebase', False): - repo._isrebasing = True - try: - if opts.get('update'): - del opts['update'] - ui.debug('--update and --rebase are not compatible, ignoring ' - 'the update flag\n') - del opts['rebase'] - origpostincoming = commands.postincoming - def _dummy(*args, **kwargs): - pass - commands.postincoming = _dummy - try: - result = commands.pull(ui, repo, source, **opts) - finally: - commands.postincoming = origpostincoming - revspostpull = len(repo) - if revspostpull > revsprepull: - result = result or rebase.rebase(ui, repo) - finally: - repo._isrebasing = False - else: - result = orig(ui, repo, source, **opts) + result = orig(ui, repo, source, **opts) revspostpull = len(repo) lfrevs = opts.get('lfrev', []) if opts.get('all_largefiles'): @@ -816,11 +790,14 @@ return result def overriderebase(orig, ui, repo, **opts): - repo._isrebasing = True + resuming = opts.get('continue') + repo._lfcommithooks.append(lfutil.automatedcommithook(resuming)) + repo._lfstatuswriters.append(lambda *msg, **opts: None) try: return orig(ui, repo, **opts) finally: - repo._isrebasing = False + repo._lfstatuswriters.pop() + repo._lfcommithooks.pop() def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None, prefix=None, mtime=None, subrepos=None): @@ -1302,9 +1279,10 @@ newstandins = lfutil.getstandinsstate(repo) filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) - # suppress status message while automated committing - printmessage = not (getattr(repo, "_isrebasing", False) or - getattr(repo, "_istransplanting", False)) + printmessage = None + if getattr(repo, "_istransplanting", False): + # suppress status message while automated committing + printmessage = False lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=printmessage, normallookup=partial)
--- a/hgext/largefiles/reposetup.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/largefiles/reposetup.py Wed Nov 05 12:41:12 2014 -0600 @@ -102,12 +102,12 @@ except error.LockError: pass - # First check if there were files specified on the - # command line. If there were, and none of them were + # First check if paths or patterns were specified on the + # command line. If there were, and they don't match any # largefiles, we should just bail here and let super # handle it -- thus gaining a big performance boost. lfdirstate = lfutil.openlfdirstate(ui, self) - if match.files() and not match.anypats(): + if not match.always(): for f in lfdirstate: if match(f): break @@ -243,9 +243,14 @@ # As part of committing, copy all of the largefiles into the # cache. - def commitctx(self, *args, **kwargs): - node = super(lfilesrepo, self).commitctx(*args, **kwargs) + def commitctx(self, ctx, *args, **kwargs): + node = super(lfilesrepo, self).commitctx(ctx, *args, **kwargs) lfutil.copyalltostore(self, node) + class lfilesctx(ctx.__class__): + def markcommitted(self, node): + orig = super(lfilesctx, self).markcommitted + return lfutil.markcommitted(orig, self, node) + ctx.__class__ = lfilesctx return node # Before commit, largefile standins have not had their @@ -257,139 +262,10 @@ wlock = self.wlock() try: - # Case 0: Automated committing - # - # While automated committing (like rebase, transplant - # and so on), this code path is used to avoid: - # (1) updating standins, because standins should - # be already updated at this point - # (2) aborting when stadnins are matched by "match", - # because automated committing may specify them directly - # - if getattr(self, "_isrebasing", False) or \ - getattr(self, "_istransplanting", False): - result = orig(text=text, user=user, date=date, match=match, - force=force, editor=editor, extra=extra) - - if result: - lfdirstate = lfutil.openlfdirstate(ui, self) - for f in self[result].files(): - if lfutil.isstandin(f): - lfile = lfutil.splitstandin(f) - lfutil.synclfdirstate(self, lfdirstate, lfile, - False) - lfdirstate.write() - - return result - # Case 1: user calls commit with no specific files or - # include/exclude patterns: refresh and commit all files that - # are "dirty". - if ((match is None) or - (not match.anypats() and not match.files())): - # Spend a bit of time here to get a list of files we know - # are modified so we can compare only against those. - # It can cost a lot of time (several seconds) - # otherwise to update all standins if the largefiles are - # large. - lfdirstate = lfutil.openlfdirstate(ui, self) - dirtymatch = match_.always(self.root, self.getcwd()) - unsure, s = lfdirstate.status(dirtymatch, [], False, False, - False) - modifiedfiles = unsure + s.modified + s.added + s.removed - lfiles = lfutil.listlfiles(self) - # this only loops through largefiles that exist (not - # removed/renamed) - for lfile in lfiles: - if lfile in modifiedfiles: - if os.path.exists( - self.wjoin(lfutil.standin(lfile))): - # this handles the case where a rebase is being - # performed and the working copy is not updated - # yet. - if os.path.exists(self.wjoin(lfile)): - lfutil.updatestandin(self, - lfutil.standin(lfile)) - lfdirstate.normal(lfile) - - result = orig(text=text, user=user, date=date, match=match, - force=force, editor=editor, extra=extra) - - if result is not None: - for lfile in lfdirstate: - if lfile in modifiedfiles: - if (not os.path.exists(self.wjoin( - lfutil.standin(lfile)))) or \ - (not os.path.exists(self.wjoin(lfile))): - lfdirstate.drop(lfile) - - # This needs to be after commit; otherwise precommit hooks - # get the wrong status - lfdirstate.write() - return result - - lfiles = lfutil.listlfiles(self) - match._files = self._subdirlfs(match.files(), lfiles) - - # Case 2: user calls commit with specified patterns: refresh - # any matching big files. - smatcher = lfutil.composestandinmatcher(self, match) - standins = self.dirstate.walk(smatcher, [], False, False) - - # No matching big files: get out of the way and pass control to - # the usual commit() method. - if not standins: - return orig(text=text, user=user, date=date, match=match, - force=force, editor=editor, extra=extra) - - # Refresh all matching big files. It's possible that the - # commit will end up failing, in which case the big files will - # stay refreshed. No harm done: the user modified them and - # asked to commit them, so sooner or later we're going to - # refresh the standins. Might as well leave them refreshed. - lfdirstate = lfutil.openlfdirstate(ui, self) - for standin in standins: - lfile = lfutil.splitstandin(standin) - if lfdirstate[lfile] != 'r': - lfutil.updatestandin(self, standin) - lfdirstate.normal(lfile) - else: - lfdirstate.drop(lfile) - - # Cook up a new matcher that only matches regular files or - # standins corresponding to the big files requested by the - # user. Have to modify _files to prevent commit() from - # complaining "not tracked" for big files. - match = copy.copy(match) - origmatchfn = match.matchfn - - # Check both the list of largefiles and the list of - # standins because if a largefile was removed, it - # won't be in the list of largefiles at this point - match._files += sorted(standins) - - actualfiles = [] - for f in match._files: - fstandin = lfutil.standin(f) - - # ignore known largefiles and standins - if f in lfiles or fstandin in standins: - continue - - actualfiles.append(f) - match._files = actualfiles - - def matchfn(f): - if origmatchfn(f): - return f not in lfiles - else: - return f in standins - - match.matchfn = matchfn + lfcommithook = self._lfcommithooks[-1] + match = lfcommithook(self, match) result = orig(text=text, user=user, date=date, match=match, force=force, editor=editor, extra=extra) - # This needs to be after commit; otherwise precommit hooks - # get the wrong status - lfdirstate.write() return result finally: wlock.release() @@ -405,6 +281,8 @@ return super(lfilesrepo, self).push(remote, force=force, revs=revs, newbranch=newbranch) + # TODO: _subdirlfs should be moved into "lfutil.py", because + # it is referred only from "lfutil.updatestandinsbymatch" def _subdirlfs(self, files, lfiles): ''' Adjust matched file list @@ -461,6 +339,15 @@ repo.__class__ = lfilesrepo + # stack of hooks being executed before committing. + # only last element ("_lfcommithooks[-1]") is used for each committing. + repo._lfcommithooks = [lfutil.updatestandinsbymatch] + + # Stack of status writer functions taking "*msg, **opts" arguments + # like "ui.status()". Only last element ("_lfupdatereporters[-1]") + # is used to write status out. + repo._lfstatuswriters = [ui.status] + def prepushoutgoinghook(local, remote, outgoing): if outgoing.missing: toupload = set()
--- a/hgext/largefiles/uisetup.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/largefiles/uisetup.py Wed Nov 05 12:41:12 2014 -0600 @@ -169,6 +169,8 @@ if name == 'rebase': extensions.wrapcommand(getattr(module, 'cmdtable'), 'rebase', overrides.overriderebase) + extensions.wrapfunction(module, 'rebase', + overrides.overriderebase) if name == 'transplant': extensions.wrapcommand(getattr(module, 'cmdtable'), 'transplant', overrides.overridetransplant)
--- a/hgext/patchbomb.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/patchbomb.py Wed Nov 05 12:41:12 2014 -0600 @@ -483,14 +483,14 @@ replyto = getaddrs('Reply-To') if opts.get('diffstat') or opts.get('confirm'): - ui.write(_('\nFinal summary:\n\n')) - ui.write(('From: %s\n' % sender)) + ui.write(_('\nFinal summary:\n\n'), label='patchbomb.finalsummary') + ui.write(('From: %s\n' % sender), label='patchbomb.from') for addr in showaddrs: - ui.write('%s\n' % addr) + ui.write('%s\n' % addr, label='patchbomb.to') for m, subj, ds in msgs: - ui.write(('Subject: %s\n' % subj)) + ui.write(('Subject: %s\n' % subj), label='patchbomb.subject') if ds: - ui.write(ds) + ui.write(ds, label='patchbomb.diffstats') ui.write('\n') if ui.promptchoice(_('are you sure you want to send (yn)?' '$$ &Yes $$ &No')):
--- a/hgext/rebase.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/rebase.py Wed Nov 05 12:41:12 2014 -0600 @@ -278,7 +278,7 @@ commonanc, base, commonanc) if not rebaseset: # transform to list because smartsets are not comparable to - # lists. This should be improved to honor lazyness of + # lists. This should be improved to honor laziness of # smartset. if list(base) == [dest.rev()]: if basef:
--- a/hgext/strip.py Wed Nov 05 17:25:00 2014 +0000 +++ b/hgext/strip.py Wed Nov 05 12:41:12 2014 -0600 @@ -1,4 +1,4 @@ -"""strip changesets and their descendents from history +"""strip changesets and their descendants from history This extension allows you to strip changesets and all their descendants from the repository. See the command help for details.
--- a/i18n/polib.py Wed Nov 05 17:25:00 2014 +0000 +++ b/i18n/polib.py Wed Nov 05 12:41:12 2014 -0600 @@ -396,7 +396,7 @@ def ordered_metadata(self): """ Convenience method that returns an ordered version of the metadata - dictionnary. The return value is list of tuples (metadata name, + dictionary. The return value is list of tuples (metadata name, metadata_value). """ # copy the dict first
--- a/mercurial/bundle2.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/bundle2.py Wed Nov 05 12:41:12 2014 -0600 @@ -229,7 +229,7 @@ self.getreplies(inreplyto).add(category, entry) def getreplies(self, partid): - """get the subrecords that replies to a specific part""" + """get the records that are replies to a specific part""" return self._replies.setdefault(partid, unbundlerecords()) def __getitem__(self, cat): @@ -303,7 +303,7 @@ # consume the bundle content part.read() # Small hack to let caller code distinguish exceptions from bundle2 - # processing fron the ones from bundle1 processing. This is mostly + # processing from processing the old format. This is mostly # needed to handle different return codes to unbundle according to the # type of bundle. We should probably clean up or drop this return code # craziness in a future version. @@ -359,7 +359,7 @@ def decodecaps(blob): - """decode a bundle2 caps bytes blob into a dictionnary + """decode a bundle2 caps bytes blob into a dictionary The blob is a list of capabilities (one per line) Capabilities may have values using a line of the form:: @@ -741,7 +741,7 @@ self.ui.debug('bundle2 stream interruption, looking for a part.\n') headerblock = self._readpartheader() if headerblock is None: - self.ui.debug('no part found during iterruption.\n') + self.ui.debug('no part found during interruption.\n') return part = unbundlepart(self.ui, headerblock, self._fp) op = interruptoperation(self.ui) @@ -828,7 +828,7 @@ # split mandatory from advisory mansizes = paramsizes[:mancount] advsizes = paramsizes[mancount:] - # retrive param value + # retrieve param value manparams = [] for key, value in mansizes: manparams.append((self._fromheader(key), self._fromheader(value))) @@ -882,13 +882,14 @@ Exists to allow extensions (like evolution) to mutate the capabilities. """ caps = capabilities.copy() + caps['b2x:changegroup'] = tuple(sorted(changegroup.packermap.keys())) if obsolete.isenabled(repo, obsolete.exchangeopt): supportedformat = tuple('V%i' % v for v in obsolete.formats) caps['b2x:obsmarkers'] = supportedformat return caps def bundle2caps(remote): - """return the bundlecapabilities of a peer as dict""" + """return the bundle capabilities of a peer as dict""" raw = remote.capable('bundle2-exp') if not raw and raw != '': return {} @@ -901,7 +902,7 @@ obscaps = caps.get('b2x:obsmarkers', ()) return [int(c[1:]) for c in obscaps if c.startswith('V')] -@parthandler('b2x:changegroup') +@parthandler('b2x:changegroup', ('version',)) def handlechangegroup(op, inpart): """apply a changegroup part on the repo @@ -914,13 +915,16 @@ # we need to make sure we trigger the creation of a transaction object used # for the whole processing scope. op.gettransaction() - cg = changegroup.cg1unpacker(inpart, 'UN') + unpackerversion = inpart.params.get('version', '01') + # We should raise an appropriate exception here + unpacker = changegroup.packermap[unpackerversion][1] + cg = unpacker(inpart, 'UN') # the source and url passed here are overwritten by the one contained in # the transaction.hookargs argument. So 'bundle2' is a placeholder ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2') op.records.add('changegroup', {'return': ret}) if op.reply is not None: - # This is definitly not the final form of this + # This is definitely not the final form of this # return. But one need to start somewhere. part = op.reply.newpart('b2x:reply:changegroup') part.addparam('in-reply-to', str(inpart.id), mandatory=False) @@ -989,7 +993,7 @@ ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2') op.records.add('changegroup', {'return': ret}) if op.reply is not None: - # This is definitly not the final form of this + # This is definitely not the final form of this # return. But one need to start somewhere. part = op.reply.newpart('b2x:reply:changegroup') part.addparam('in-reply-to', str(inpart.id), mandatory=False)
--- a/mercurial/changegroup.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/changegroup.py Wed Nov 05 12:41:12 2014 -0600 @@ -13,6 +13,7 @@ import discovery, error, phases, branchmap _CHANGEGROUPV1_DELTA_HEADER = "20s20s20s20s" +_CHANGEGROUPV2_DELTA_HEADER = "20s20s20s20s20s" def readexactly(stream, n): '''read n bytes from stream.read and abort if less was available''' @@ -215,6 +216,14 @@ pos = next yield closechunk() +class cg2unpacker(cg1unpacker): + deltaheader = _CHANGEGROUPV2_DELTA_HEADER + deltaheadersize = struct.calcsize(deltaheader) + + def _deltaheader(self, headertuple, prevnode): + node, p1, p2, deltabase, cs = headertuple + return node, p1, p2, deltabase, cs + class headerlessfixup(object): def __init__(self, fh, h): self._h = h @@ -410,10 +419,13 @@ reorder=reorder): yield chunk + def deltaparent(self, revlog, rev, p1, p2, prev): + return prev + def revchunk(self, revlog, rev, prev, linknode): node = revlog.node(rev) p1, p2 = revlog.parentrevs(rev) - base = prev + base = self.deltaparent(revlog, rev, p1, p2, prev) prefix = '' if base == nullrev: @@ -433,6 +445,30 @@ # do nothing with basenode, it is implicitly the previous one in HG10 return struct.pack(self.deltaheader, node, p1n, p2n, linknode) +class cg2packer(cg1packer): + + deltaheader = _CHANGEGROUPV2_DELTA_HEADER + + def group(self, nodelist, revlog, lookup, units=None, reorder=None): + if (revlog._generaldelta and reorder is not True): + reorder = False + return cg1packer.group(self, nodelist, revlog, lookup, + units=units, reorder=reorder) + + def deltaparent(self, revlog, rev, p1, p2, prev): + dp = revlog.deltaparent(rev) + # avoid storing full revisions; pick prev in those cases + # also pick prev when we can't be sure remote has dp + if dp == nullrev or (dp != p1 and dp != p2 and dp != prev): + return prev + return dp + + def builddeltaheader(self, node, p1n, p2n, basenode, linknode): + return struct.pack(self.deltaheader, node, p1n, p2n, basenode, linknode) + +packermap = {'01': (cg1packer, cg1unpacker), + '02': (cg2packer, cg2unpacker)} + def _changegroupinfo(repo, nodes, source): if repo.ui.verbose or source == 'bundle': repo.ui.status(_("%d changesets found\n") % len(nodes)) @@ -441,7 +477,7 @@ for node in nodes: repo.ui.debug("%s\n" % hex(node)) -def getsubset(repo, outgoing, bundler, source, fastpath=False): +def getsubsetraw(repo, outgoing, bundler, source, fastpath=False): repo = repo.unfiltered() commonrevs = outgoing.common csets = outgoing.missing @@ -455,7 +491,10 @@ repo.hook('preoutgoing', throw=True, source=source) _changegroupinfo(repo, csets, source) - gengroup = bundler.generate(commonrevs, csets, fastpathlinkrev, source) + return bundler.generate(commonrevs, csets, fastpathlinkrev, source) + +def getsubset(repo, outgoing, bundler, source, fastpath=False): + gengroup = getsubsetraw(repo, outgoing, bundler, source, fastpath) return cg1unpacker(util.chunkbuffer(gengroup), 'UN') def changegroupsubset(repo, roots, heads, source): @@ -483,6 +522,17 @@ bundler = cg1packer(repo) return getsubset(repo, outgoing, bundler, source) +def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None, + version='01'): + """Like getbundle, but taking a discovery.outgoing as an argument. + + This is only implemented for local repos and reuses potentially + precomputed sets in outgoing. Returns a raw changegroup generator.""" + if not outgoing.missing: + return None + bundler = packermap[version][0](repo, bundlecaps) + return getsubsetraw(repo, outgoing, bundler, source) + def getlocalchangegroup(repo, source, outgoing, bundlecaps=None): """Like getbundle, but taking a discovery.outgoing as an argument. @@ -512,6 +562,22 @@ heads = cl.heads() return discovery.outgoing(cl, common, heads) +def getchangegroupraw(repo, source, heads=None, common=None, bundlecaps=None, + version='01'): + """Like changegroupsubset, but returns the set difference between the + ancestors of heads and the ancestors common. + + If heads is None, use the local heads. If common is None, use [nullid]. + + If version is None, use a version '1' changegroup. + + The nodes in common might not all be known locally due to the way the + current discovery protocol works. Returns a raw changegroup generator. + """ + outgoing = _computeoutgoing(repo, heads, common) + return getlocalchangegroupraw(repo, source, outgoing, bundlecaps=bundlecaps, + version=version) + def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None): """Like changegroupsubset, but returns the set difference between the ancestors of heads and the ancestors common.
--- a/mercurial/cmdutil.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/cmdutil.py Wed Nov 05 12:41:12 2014 -0600 @@ -113,7 +113,7 @@ def mergeeditform(ctxorbool, baseform): """build appropriate editform from ctxorbool and baseform - 'cxtorbool' is one of a ctx to be committed, or a bool whether + 'ctxorbool' is one of a ctx to be committed, or a bool whether merging is committed. This returns editform 'baseform' with '.merge' if merging is @@ -1783,8 +1783,8 @@ # If we're forced to take the slowpath it means we're following # at least one pattern/directory, so don't bother with rename tracking. if follow and not match.always() and not slowpath: - # _makelogfilematcher expects its files argument to be relative to - # the repo root, so use match.files(), not pats. + # _makefollowlogfilematcher expects its files argument to be + # relative to the repo root, so use match.files(), not pats. filematcher = _makefollowlogfilematcher(repo, match.files(), followfirst) else: @@ -2522,11 +2522,11 @@ deladded = _deleted - smf deleted = _deleted - deladded - # We need to account for the state of file in the dirstate + # We need to account for the state of file in the dirstate. # - # Even, when we revert agains something else than parent. this will + # Even, when we revert against something else than parent. This will # slightly alter the behavior of revert (doing back up or not, delete - # or just forget etc) + # or just forget etc). if parent == node: dsmodified = modified dsadded = added
--- a/mercurial/context.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/context.py Wed Nov 05 12:41:12 2014 -0600 @@ -109,7 +109,7 @@ """provide a hook to allow child objects to postprocess status results For example, this allows other contexts, such as workingctx, to filter - suspect symlinks in the case of FAT32 and NTFS filesytems. + suspect symlinks in the case of FAT32 and NTFS filesystems. """ return s @@ -1415,7 +1415,7 @@ def _prestatus(self, other, s, match, listignored, listclean, listunknown): """override the parent hook with a dirstate query - We use this prestatus hook to populate the status with information from + We use this _prestatus hook to populate the status with information from the dirstate. """ # doesn't need to call super; if that changes, be aware that super @@ -1426,9 +1426,9 @@ def _poststatus(self, other, s, match, listignored, listclean, listunknown): """override the parent hook with a filter for suspect symlinks - We use this poststatus hook to filter out symlinks that might have + We use this _poststatus hook to filter out symlinks that might have accidentally ended up with the entire contents of the file they are - susposed to be linking to. + supposed to be linking to. """ s[0] = self._filtersuspectsymlink(s[0]) self._status = scmutil.status(*s) @@ -1693,7 +1693,7 @@ class memfilectx(committablefilectx): """memfilectx represents an in-memory file to commit. - See memctx and commitablefilectx for more details. + See memctx and committablefilectx for more details. """ def __init__(self, repo, path, data, islink=False, isexec=False, copied=None, memctx=None):
--- a/mercurial/copies.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/copies.py Wed Nov 05 12:41:12 2014 -0600 @@ -97,7 +97,7 @@ # |/ # o 0 a0 # - # When findlimit is called, a and b are revs 3 and 0, so limit will be 2, + # When _findlimit is called, a and b are revs 3 and 0, so limit will be 2, # yet the filelog has the copy information in rev 1 and we will not look # back far enough unless we also look at the a and b as candidates. # This only occurs when a is a descendent of b or visa-versa.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mercurial/default.d/mergetools.rc Wed Nov 05 12:41:12 2014 -0600 @@ -0,0 +1,135 @@ +# Some default global settings for common merge tools + +[merge-tools] +kdiff3.args=--auto --L1 base --L2 local --L3 other $base $local $other -o $output +kdiff3.regkey=Software\KDiff3 +kdiff3.regkeyalt=Software\Wow6432Node\KDiff3 +kdiff3.regappend=\kdiff3.exe +kdiff3.fixeol=True +kdiff3.gui=True +kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child + +gvimdiff.args=--nofork -d -g -O $local $other $base +gvimdiff.regkey=Software\Vim\GVim +gvimdiff.regkeyalt=Software\Wow6432Node\Vim\GVim +gvimdiff.regname=path +gvimdiff.priority=-9 +gvimdiff.diffargs=--nofork -d -g -O $parent $child + +vimdiff.args=$local $other $base -c 'redraw | echomsg "hg merge conflict, type \":cq\" to abort vimdiff"' +vimdiff.check=changed +vimdiff.priority=-10 + +merge.check=conflicts +merge.priority=-100 + +gpyfm.gui=True + +meld.gui=True +meld.args=--label='local' $local --label='merged' $base --label='other' $other -o $output +meld.check=changed +meld.diffargs=-a --label='$plabel1' $parent --label='$clabel' $child + +tkdiff.args=$local $other -a $base -o $output +tkdiff.gui=True +tkdiff.priority=-8 +tkdiff.diffargs=-L '$plabel1' $parent -L '$clabel' $child + +xxdiff.args=--show-merged-pane --exit-with-merge-status --title1 local --title2 base --title3 other --merged-filename $output --merge $local $base $other +xxdiff.gui=True +xxdiff.priority=-8 +xxdiff.diffargs=--title1 '$plabel1' $parent --title2 '$clabel' $child + +diffmerge.regkey=Software\SourceGear\SourceGear DiffMerge\ +diffmerge.regkeyalt=Software\Wow6432Node\SourceGear\SourceGear DiffMerge\ +diffmerge.regname=Location +diffmerge.priority=-7 +diffmerge.args=-nosplash -merge -title1=local -title2=merged -title3=other $local $base $other -result=$output +diffmerge.check=changed +diffmerge.gui=True +diffmerge.diffargs=--nosplash --title1='$plabel1' --title2='$clabel' $parent $child + +p4merge.args=$base $local $other $output +p4merge.regkey=Software\Perforce\Environment +p4merge.regkeyalt=Software\Wow6432Node\Perforce\Environment +p4merge.regname=P4INSTROOT +p4merge.regappend=\p4merge.exe +p4merge.gui=True +p4merge.priority=-8 +p4merge.diffargs=$parent $child + +p4mergeosx.executable = /Applications/p4merge.app/Contents/MacOS/p4merge +p4mergeosx.args = $base $local $other $output +p4mergeosx.gui = True +p4mergeosx.priority=-8 +p4mergeosx.diffargs=$parent $child + +tortoisemerge.args=/base:$base /mine:$local /theirs:$other /merged:$output +tortoisemerge.regkey=Software\TortoiseSVN +tortoisemerge.regkeyalt=Software\Wow6432Node\TortoiseSVN +tortoisemerge.check=changed +tortoisemerge.gui=True +tortoisemerge.priority=-8 +tortoisemerge.diffargs=/base:$parent /mine:$child /basename:'$plabel1' /minename:'$clabel' + +ecmerge.args=$base $local $other --mode=merge3 --title0=base --title1=local --title2=other --to=$output +ecmerge.regkey=Software\Elli\xc3\xa9 Computing\Merge +ecmerge.regkeyalt=Software\Wow6432Node\Elli\xc3\xa9 Computing\Merge +ecmerge.gui=True +ecmerge.diffargs=$parent $child --mode=diff2 --title1='$plabel1' --title2='$clabel' + +# editmerge is a small script shipped in contrib. +# It needs this config otherwise it behaves the same as internal:local +editmerge.args=$output +editmerge.check=changed +editmerge.premerge=keep + +filemerge.executable=/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge +filemerge.args=-left $other -right $local -ancestor $base -merge $output +filemerge.gui=True + +; Windows version of Beyond Compare +beyondcompare3.args=$local $other $base $output /ro /lefttitle=local /centertitle=base /righttitle=other /automerge /reviewconflicts /solo +beyondcompare3.regkey=Software\Scooter Software\Beyond Compare 3 +beyondcompare3.regname=ExePath +beyondcompare3.gui=True +beyondcompare3.priority=-2 +beyondcompare3.diffargs=/lro /lefttitle='$plabel1' /righttitle='$clabel' /solo /expandall $parent $child + +; Linux version of Beyond Compare +bcompare.args=$local $other $base -mergeoutput=$output -ro -lefttitle=parent1 -centertitle=base -righttitle=parent2 -outputtitle=merged -automerge -reviewconflicts -solo +bcompare.gui=True +bcompare.priority=-1 +bcompare.diffargs=-lro -lefttitle='$plabel1' -righttitle='$clabel' -solo -expandall $parent $child + +winmerge.args=/e /x /wl /ub /dl other /dr local $other $local $output +winmerge.regkey=Software\Thingamahoochie\WinMerge +winmerge.regkeyalt=Software\Wow6432Node\Thingamahoochie\WinMerge\ +winmerge.regname=Executable +winmerge.check=changed +winmerge.gui=True +winmerge.priority=-10 +winmerge.diffargs=/r /e /x /ub /wl /dl '$plabel1' /dr '$clabel' $parent $child + +araxis.regkey=SOFTWARE\Classes\TypeLib\{46799e0a-7bd1-4330-911c-9660bb964ea2}\7.0\HELPDIR +araxis.regappend=\ConsoleCompare.exe +araxis.priority=-2 +araxis.args=/3 /a2 /wait /merge /title1:"Other" /title2:"Base" /title3:"Local :"$local $other $base $local $output +araxis.checkconflict=True +araxis.binary=True +araxis.gui=True +araxis.diffargs=/2 /wait /title1:"$plabel1" /title2:"$clabel" $parent $child + +diffuse.priority=-3 +diffuse.args=$local $base $other +diffuse.gui=True +diffuse.diffargs=$parent $child + +UltraCompare.regkey=Software\Microsoft\Windows\CurrentVersion\App Paths\UC.exe +UltraCompare.regkeyalt=Software\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\UC.exe +UltraCompare.args = $base $local $other -title1 base -title3 other +UltraCompare.priority = -2 +UltraCompare.gui = True +UltraCompare.binary = True +UltraCompare.check = conflicts,changed +UltraCompare.diffargs=$child $parent -title1 $clabel -title2 $plabel1
--- a/mercurial/exchange.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/exchange.py Wed Nov 05 12:41:12 2014 -0600 @@ -298,7 +298,7 @@ else: # adds changeset we are going to push as draft # - # should not be necessary for pushblishing server, but because of an + # should not be necessary for publishing server, but because of an # issue fixed in xxxxx we have to do it anyway. fdroots = list(unfi.set('roots(%ln + %ln::)', outgoing.missing, droots)) @@ -445,10 +445,25 @@ pushop.outgoing) if not pushop.force: bundler.newpart('B2X:CHECK:HEADS', data=iter(pushop.remoteheads)) - cg = changegroup.getlocalchangegroup(pushop.repo, 'push', pushop.outgoing) - cgpart = bundler.newpart('B2X:CHANGEGROUP', data=cg.getchunks()) + b2caps = bundle2.bundle2caps(pushop.remote) + version = None + cgversions = b2caps.get('b2x:changegroup') + if cgversions is None: + cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push', + pushop.outgoing) + else: + cgversions = [v for v in cgversions if v in changegroup.packermap] + if not cgversions: + raise ValueError(_('no common changegroup version')) + version = max(cgversions) + cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push', + pushop.outgoing, + version=version) + cgpart = bundler.newpart('B2X:CHANGEGROUP', data=cg) + if version is not None: + cgpart.addparam('version', version) def handlereply(op): - """extract addchangroup returns from server reply""" + """extract addchangegroup returns from server reply""" cgreplies = op.records.getreplies(cgpart.id) assert len(cgreplies['changegroup']) == 1 pushop.cgresult = cgreplies['changegroup'][0]['return'] @@ -702,7 +717,7 @@ pushop.ui.warn(msg) else: - # fallback to independant pushkey command + # fallback to independent pushkey command for newremotehead in outdated: r = pushop.remote.pushkey('phases', newremotehead.hex(), @@ -1185,11 +1200,26 @@ cg = None if kwargs.get('cg', True): # build changegroup bundle here. - cg = changegroup.getchangegroup(repo, source, heads=heads, - common=common, bundlecaps=bundlecaps) + version = None + cgversions = b2caps.get('b2x:changegroup') + if cgversions is None: + cg = changegroup.getchangegroupraw(repo, source, heads=heads, + common=common, + bundlecaps=bundlecaps) + else: + cgversions = [v for v in cgversions if v in changegroup.packermap] + if not cgversions: + raise ValueError(_('no common changegroup version')) + version = max(cgversions) + cg = changegroup.getchangegroupraw(repo, source, heads=heads, + common=common, + bundlecaps=bundlecaps, + version=version) if cg: - bundler.newpart('b2x:changegroup', data=cg.getchunks()) + part = bundler.newpart('b2x:changegroup', data=cg) + if version is not None: + part.addparam('version', version) @getbundle2partsgenerator('listkeys') def _getbundlelistkeysparts(bundler, repo, source, bundlecaps=None,
--- a/mercurial/filemerge.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/filemerge.py Wed Nov 05 12:41:12 2014 -0600 @@ -37,6 +37,9 @@ def _findtool(ui, tool): if tool in internals: return tool + return findexternaltool(ui, tool) + +def findexternaltool(ui, tool): for kn in ("regkey", "regkeyalt"): k = _toolstr(ui, tool, kn) if not k:
--- a/mercurial/help/config.txt Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/help/config.txt Wed Nov 05 12:41:12 2014 -0600 @@ -38,6 +38,7 @@ - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation) - ``/etc/mercurial/hgrc`` (per-system) - ``/etc/mercurial/hgrc.d/*.rc`` (per-system) + - ``<internal>/default.d/*.rc`` (defaults) .. container:: verbose.windows @@ -51,6 +52,7 @@ - ``<install-dir>\Mercurial.ini`` (per-installation) - ``<install-dir>\hgrc.d\*.rc`` (per-installation) - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation) + - ``<internal>/default.d/*.rc`` (defaults) .. note:: @@ -67,6 +69,7 @@ - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation) - ``/lib/mercurial/hgrc`` (per-system) - ``/lib/mercurial/hgrc.d/*.rc`` (per-system) + - ``<internal>/default.d/*.rc`` (defaults) Per-repository configuration options only apply in a particular repository. This file is not version-controlled, and @@ -102,6 +105,13 @@ executed by any user in any directory. Options in these files override per-installation options. +Mercurial comes with some default configuration. The default configuration +files are installed with Mercurial and will be overwritten on upgrades. Default +configuration files should never be edited by users or administrators but can +be overridden in other configuration files. So far the directory only contains +merge tool configuration but packagers can also put other default configuration +there. + Syntax ======
--- a/mercurial/hg.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/hg.py Wed Nov 05 12:41:12 2014 -0600 @@ -390,7 +390,7 @@ dstcachedir = os.path.join(destpath, 'cache') # In local clones we're copying all nodes, not just served - # ones. Therefore copy all branchcaches over. + # ones. Therefore copy all branch caches over. copybranchcache('branch2') for cachename in repoview.filtertable: copybranchcache('branch2-%s' % cachename)
--- a/mercurial/pathutil.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/pathutil.py Wed Nov 05 12:41:12 2014 -0600 @@ -146,7 +146,7 @@ def normasprefix(path): '''normalize the specified path as path prefix - Returned vaule can be used safely for "p.startswith(prefix)", + Returned value can be used safely for "p.startswith(prefix)", "p[len(prefix):]", and so on. For efficiency, this expects "path" argument to be already
--- a/mercurial/revset.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/revset.py Wed Nov 05 12:41:12 2014 -0600 @@ -265,9 +265,8 @@ return stringset(repo, subset, x) def rangeset(repo, subset, x, y): - cl = baseset(repo.changelog) - m = getset(repo, cl, x) - n = getset(repo, cl, y) + m = getset(repo, fullreposet(repo), x) + n = getset(repo, fullreposet(repo), y) if not m or not n: return baseset() @@ -371,7 +370,7 @@ raise error.ParseError(_("~ expects a number")) ps = set() cl = repo.changelog - for r in getset(repo, baseset(cl), x): + for r in getset(repo, fullreposet(repo), x): for i in range(n): r = cl.parentrevs(r)[0] ps.add(r) @@ -573,7 +572,7 @@ """``children(set)`` Child changesets of changesets in set. """ - s = getset(repo, baseset(repo), x) + s = getset(repo, fullreposet(repo), x) cs = _children(repo, subset, s) return subset & cs @@ -1258,7 +1257,7 @@ raise error.ParseError(_("^ expects a number 0, 1, or 2")) ps = set() cl = repo.changelog - for r in getset(repo, baseset(cl), x): + for r in getset(repo, fullreposet(repo), x): if n == 0: ps.add(r) elif n == 1: @@ -1384,7 +1383,7 @@ # i18n: "matching" is a keyword l = getargs(x, 1, 2, _("matching takes 1 or 2 arguments")) - revs = getset(repo, baseset(repo.changelog), l[0]) + revs = getset(repo, fullreposet(repo), l[0]) fieldlist = ['metadata'] if len(l) > 1: @@ -2551,7 +2550,7 @@ return it() def _trysetasclist(self): - """populate the _asclist attribut if possible and necessary""" + """populate the _asclist attribute if possible and necessary""" if self._genlist is not None and self._asclist is None: self._asclist = sorted(self._genlist) @@ -2744,7 +2743,7 @@ # We have to use this complex iteration strategy to allow multiple # iterations at the same time. We need to be able to catch revision - # removed from `consumegen` and added to genlist in another instance. + # removed from _consumegen and added to genlist in another instance. # # Getting rid of it would provide an about 15% speed up on this # iteration. @@ -2939,17 +2938,15 @@ class fullreposet(_spanset): """a set containing all revisions in the repo - This class exists to host special optimisation. + This class exists to host special optimization. """ def __init__(self, repo): super(fullreposet, self).__init__(repo) def __and__(self, other): - """fullrepo & other -> other - - As self contains the whole repo, all of the other set should also be in - self. Therefor `self & other = other`. + """As self contains the whole repo, all of the other set should also be + in self. Therefore `self & other = other`. This boldly assumes the other contains valid revs only. """
--- a/mercurial/scmutil.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/scmutil.py Wed Nov 05 12:41:12 2014 -0600 @@ -495,7 +495,13 @@ def osrcpath(): '''return default os-specific hgrc search path''' - path = systemrcpath() + path = [] + defaultpath = os.path.join(util.datapath, 'default.d') + if os.path.isdir(defaultpath): + for f, kind in osutil.listdir(defaultpath): + if f.endswith('.rc'): + path.append(os.path.join(defaultpath, f)) + path.extend(systemrcpath()) path.extend(userrcpath()) path = [os.path.normpath(f) for f in path] return path
--- a/mercurial/tagmerge.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/tagmerge.py Wed Nov 05 12:41:12 2014 -0600 @@ -39,7 +39,7 @@ # and between base and p2, possibly on separate clones # 4. for each tag found both on p1 and p2 perform the following merge algorithm: # - the tags conflict if their tag "histories" have the same "rank" (i.e. -# length) _AND_ the last (current) tag is _NOT_ the same +# length) AND the last (current) tag is NOT the same # - for non conflicting tags: # - choose which are the high and the low ranking nodes # - the high ranking list of nodes is the one that is longer. @@ -57,7 +57,7 @@ # 5. write the merged tags taking into account to their positions in the first # parent (i.e. try to keep the relative ordering of the nodes that come # from p1). This minimizes the diff between the merged and the p1 tag files -# This is donw by using the following algorithm +# This is done by using the following algorithm # - group the nodes for a given tag that must be written next to each other # - A: nodes that come from consecutive lines on p1 # - B: nodes that come from p2 (i.e. whose associated line number is @@ -81,9 +81,9 @@ def readtagsformerge(ui, repo, lines, fn='', keeplinenums=False): '''read the .hgtags file into a structure that is suitable for merging - Sepending on the keeplinenumbers flag, clear the line numbers associated - with each tag. Rhis is done because only the line numbers of the first - parent are useful for merging + Depending on the keeplinenums flag, clear the line numbers associated + with each tag. This is done because only the line numbers of the first + parent are useful for merging. ''' filetags = tagsmod._readtaghist(ui, repo, lines, fn=fn, recode=None, calcnodelines=True)[1]
--- a/mercurial/tags.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/tags.py Wed Nov 05 12:41:12 2014 -0600 @@ -87,7 +87,7 @@ def _readtaghist(ui, repo, lines, fn, recode=None, calcnodelines=False): '''Read tag definitions from a file (or any source of lines). This function returns two sortdicts with similar information: - - the first dict, bingtaglist, contains the tag information as expected by + - the first dict, bintaghist, contains the tag information as expected by the _readtags function, i.e. a mapping from tag name to (node, hist): - node is the node id from the last line read for that name, - hist is the list of node ids previously associated with it (in file
--- a/mercurial/ui.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/ui.py Wed Nov 05 12:41:12 2014 -0600 @@ -537,7 +537,7 @@ return path or loc def pushbuffer(self, error=False): - """install a buffer to capture standar output of the ui object + """install a buffer to capture standard output of the ui object If error is True, the error output will be captured too.""" self._buffers.append([])
--- a/mercurial/util.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/util.py Wed Nov 05 12:41:12 2014 -0600 @@ -1148,7 +1148,7 @@ """Read L bytes of data from the iterator of chunks of data. Returns less than L bytes if the iterator runs dry. - If size parameter is ommited, read everything""" + If size parameter is omitted, read everything""" left = l buf = [] queue = self._queue
--- a/mercurial/wireproto.py Wed Nov 05 17:25:00 2014 +0000 +++ b/mercurial/wireproto.py Wed Nov 05 12:41:12 2014 -0600 @@ -827,7 +827,7 @@ r = exchange.unbundle(repo, gen, their_heads, 'serve', proto._client()) if util.safehasattr(r, 'addpart'): - # The return looks streameable, we are in the bundle2 case and + # The return looks streamable, we are in the bundle2 case and # should return a stream. return streamres(r.getchunks()) return pushres(r)
--- a/setup.py Wed Nov 05 17:25:00 2014 +0000 +++ b/setup.py Wed Nov 05 12:41:12 2014 -0600 @@ -517,6 +517,7 @@ packagedata = {'mercurial': ['locale/*/LC_MESSAGES/hg.mo', 'help/*.txt', + 'default.d/*.rc', 'dummycert.pem']} def ordinarypath(p):
--- a/tests/dumbhttp.py Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/dumbhttp.py Wed Nov 05 12:41:12 2014 -0600 @@ -5,15 +5,18 @@ """ from optparse import OptionParser -import BaseHTTPServer, SimpleHTTPServer, os, signal, subprocess, sys +import BaseHTTPServer, SimpleHTTPServer, signal, sys +from mercurial import cmdutil -def run(server_class=BaseHTTPServer.HTTPServer, - handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler, - server_address=('localhost', 8000)): - httpd = server_class(server_address, handler_class) - httpd.serve_forever() - +class simplehttpservice(object): + def __init__(self, host, port): + self.address = (host, port) + def init(self): + self.httpd = BaseHTTPServer.HTTPServer( + self.address, SimpleHTTPServer.SimpleHTTPRequestHandler) + def run(self): + self.httpd.serve_forever() if __name__ == '__main__': parser = OptionParser() @@ -26,6 +29,7 @@ parser.add_option('-f', '--foreground', dest='foreground', action='store_true', help='do not start the HTTP server in the background') + parser.add_option('--daemon-pipefds') (options, args) = parser.parse_args() @@ -34,21 +38,9 @@ if options.foreground and options.pid: parser.error("options --pid and --foreground are mutually exclusive") - if options.foreground: - run(server_address=(options.host, options.port)) - else: - # This doesn't attempt to cleanly detach the process, as it's not - # meant to be a long-lived, independent process. As a consequence, - # it's still part of the same process group, and keeps any file - # descriptors it might have inherited besided stdin/stdout/stderr. - # Trying to do things cleanly is more complicated, requires - # OS-dependent code, and is not worth the effort. - proc = subprocess.Popen([sys.executable, __file__, '-f', - '-H', options.host, '-p', str(options.port)], - stdin=open(os.devnull, 'r'), - stdout=open(os.devnull, 'w'), - stderr=subprocess.STDOUT) - if options.pid: - fp = file(options.pid, 'wb') - fp.write(str(proc.pid) + '\n') - fp.close() + opts = {'pid_file': options.pid, + 'daemon': not options.foreground, + 'daemon_pipefds': options.daemon_pipefds} + service = simplehttpservice(options.host, options.port) + cmdutil.service(opts, initfn=service.init, runfn=service.run, + runargs=[sys.executable, __file__] + sys.argv[1:])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/generate-working-copy-states.py Wed Nov 05 12:41:12 2014 -0600 @@ -0,0 +1,50 @@ +# generate proper file state to test working copy behavior +import sys +import os + +# build the combination of possible states +combination = [] +for base in [None, 'content1']: + for parent in set([None, 'content2']) | set([base]): + for wcc in set([None, 'content3']) | set([base, parent]): + for tracked in (False, True): + def statestring(content): + return content is None and 'missing' or content + trackedstring = tracked and 'tracked' or 'untracked' + filename = "%s_%s_%s-%s" % (statestring(base), + statestring(parent), + statestring(wcc), + trackedstring) + combination.append((filename, base, parent, wcc)) + +# make sure we have stable output +combination.sort() + +# retrieve the state we must generate +target = sys.argv[1] + +# compute file content +content = [] +for filename, base, parent, wcc in combination: + if target == 'filelist': + print filename + elif target == 'base': + content.append((filename, base)) + elif target == 'parent': + content.append((filename, parent)) + elif target == 'wc': + # Make sure there is content so the file gets written and can be + # tracked. It will be deleted outside of this script. + content.append((filename, wcc or 'TOBEDELETED')) + else: + print >> sys.stderr, "unknown target:", target + sys.exit(1) + +# write actual content +for filename, data in content: + if data is not None: + f = open(filename, 'w') + f.write(data + '\n') + f.close() + elif os.path.exists(filename): + os.remove(filename)
--- a/tests/run-tests.py Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/run-tests.py Wed Nov 05 12:41:12 2014 -0600 @@ -500,7 +500,7 @@ except self.failureException, e: # This differs from unittest in that we don't capture # the stack trace. This is for historical reasons and - # this decision could be revisted in the future, + # this decision could be revisited in the future, # especially for PythonTest instances. if result.addFailure(self, str(e)): success = True @@ -1263,7 +1263,7 @@ iolock.release() class TestSuite(unittest.TestSuite): - """Custom unitest TestSuite that knows how to execute Mercurial tests.""" + """Custom unittest TestSuite that knows how to execute Mercurial tests.""" def __init__(self, testdir, jobs=1, whitelist=None, blacklist=None, retest=False, keywords=None, loop=False, @@ -1895,8 +1895,8 @@ the one we expect it to be. If not, print a warning to stderr.""" if ((self._bindir == self._pythondir) and (self._bindir != self._tmpbindir)): - # The pythondir has been infered from --with-hg flag. - # We cannot expect anything sensible here + # The pythondir has been inferred from --with-hg flag. + # We cannot expect anything sensible here. return expecthg = os.path.join(self._pythondir, 'mercurial') actualhg = self._gethgpath()
--- a/tests/test-abort-checkin.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-abort-checkin.t Wed Nov 05 12:41:12 2014 -0600 @@ -7,9 +7,11 @@ > EOF $ abspath=`pwd`/abortcommit.py - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "abortcommit = $abspath" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > abortcommit = $abspath + > EOF $ hg init foo $ cd foo
--- a/tests/test-bad-extension.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-bad-extension.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,11 +1,13 @@ $ echo 'raise Exception("bit bucket overflow")' > badext.py $ abspath=`pwd`/badext.py - $ echo '[extensions]' >> $HGRCPATH - $ echo "gpg =" >> $HGRCPATH - $ echo "hgext.gpg =" >> $HGRCPATH - $ echo "badext = $abspath" >> $HGRCPATH - $ echo "badext2 =" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > gpg = + > hgext.gpg = + > badext = $abspath + > badext2 = + > EOF $ hg -q help help *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
--- a/tests/test-branches.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-branches.t Wed Nov 05 12:41:12 2014 -0600 @@ -419,10 +419,12 @@ default branch colors: - $ echo "[extensions]" >> $HGRCPATH - $ echo "color =" >> $HGRCPATH - $ echo "[color]" >> $HGRCPATH - $ echo "mode = ansi" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > color = + > [color] + > mode = ansi + > EOF $ hg up -C c 3 files updated, 0 files merged, 2 files removed, 0 files unresolved @@ -444,14 +446,16 @@ \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc) \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc) - $ echo "[extensions]" >> $HGRCPATH - $ echo "color =" >> $HGRCPATH - $ echo "[color]" >> $HGRCPATH - $ echo "branches.active = green" >> $HGRCPATH - $ echo "branches.closed = blue" >> $HGRCPATH - $ echo "branches.current = red" >> $HGRCPATH - $ echo "branches.inactive = magenta" >> $HGRCPATH - $ echo "log.changeset = cyan" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > color = + > [color] + > branches.active = green + > branches.closed = blue + > branches.current = red + > branches.inactive = magenta + > log.changeset = cyan + > EOF custom branch colors:
--- a/tests/test-bundle2-format.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-bundle2-format.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,4 +1,4 @@ -This test is decicated to test the bundle2 container format +This test is dedicated to test the bundle2 container format It test multiple existing parts to test different feature of the container. You probably do not need to touch this test unless you change the binary encoding
--- a/tests/test-check-code.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-check-code.t Wed Nov 05 12:41:12 2014 -0600 @@ -261,7 +261,7 @@ > print _("concatenating " " by " " space %s" % v) > print _("concatenating " + " by " + " '+' %s" % v) > - > print _("maping operation in different line %s" + > print _("mapping operation in different line %s" > % v) > > print _( @@ -278,7 +278,7 @@ > print _("concatenating " + " by " + " '+' %s" % v) don't use % inside _() ./map-inside-gettext.py:6: - > print _("maping operation in different line %s" + > print _("mapping operation in different line %s" don't use % inside _() ./map-inside-gettext.py:9: > print _(
--- a/tests/test-commit-amend.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-commit-amend.t Wed Nov 05 12:41:12 2014 -0600 @@ -889,9 +889,9 @@ The way mercurial does amends is to create a temporary commit (rev 3) and then fold the new and old commits together into another commit (rev 4). During this -process, findlimit is called to check how far back to look for the transitive +process, _findlimit is called to check how far back to look for the transitive closure of file copy information, but due to the divergence of the filelog -and changelog graph topologies, before findlimit was fixed, it returned a rev +and changelog graph topologies, before _findlimit was fixed, it returned a rev which was not far enough back in this case. $ hg mv a1 a2 $ hg status --copies --rev 0
--- a/tests/test-config.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-config.t Wed Nov 05 12:41:12 2014 -0600 @@ -44,9 +44,11 @@ Test case sensitive configuration - $ echo '[Section]' >> $HGRCPATH - $ echo 'KeY = Case Sensitive' >> $HGRCPATH - $ echo 'key = lower case' >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [Section] + > KeY = Case Sensitive + > key = lower case + > EOF $ hg showconfig Section Section.KeY=Case Sensitive
--- a/tests/test-convert-clonebranches.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-convert-clonebranches.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,8 +1,10 @@ - $ echo "[extensions]" >> $HGRCPATH - $ echo "convert = " >> $HGRCPATH - $ echo "[convert]" >> $HGRCPATH - $ echo "hg.tagsbranch=0" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > convert = + > [convert] + > hg.tagsbranch = 0 + > EOF $ hg init source $ cd source $ echo a > a
--- a/tests/test-convert-cvs-branch.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-convert-cvs-branch.t Wed Nov 05 12:41:12 2014 -0600 @@ -7,10 +7,12 @@ > { > cvs -f "$@" > /dev/null > } - $ echo "[extensions]" >> $HGRCPATH - $ echo "convert = " >> $HGRCPATH - $ echo "[convert]" >> $HGRCPATH - $ echo "cvsps.cache=0" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > convert = + > [convert] + > cvsps.cache = 0 + > EOF create cvs repository
--- a/tests/test-convert-cvs-detectmerge.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-convert-cvs-detectmerge.t Wed Nov 05 12:41:12 2014 -0600 @@ -23,11 +23,13 @@ XXX copied from test-convert-cvs-synthetic - $ echo "[extensions]" >> $HGRCPATH - $ echo "convert = " >> $HGRCPATH - $ echo "[convert]" >> $HGRCPATH - $ echo "cvsps.cache=0" >> $HGRCPATH - $ echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > convert = + > [convert] + > cvsps.cache = 0 + > cvsps.mergefrom = \[MERGE from (\S+)\] + > EOF create cvs repository with one project
--- a/tests/test-convert-cvs.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-convert-cvs.t Wed Nov 05 12:41:12 2014 -0600 @@ -18,9 +18,11 @@ > print "%s hook: %d changesets"%(hooktype,len(changesets)) > EOF $ hookpath=`pwd` - $ echo "[hooks]" >> $HGRCPATH - $ echo "cvslog=python:$hookpath/cvshooks.py:cvslog" >> $HGRCPATH - $ echo "cvschangesets=python:$hookpath/cvshooks.py:cvschangesets" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [hooks] + > cvslog = python:$hookpath/cvshooks.py:cvslog + > cvschangesets = python:$hookpath/cvshooks.py:cvschangesets + > EOF create cvs repository
--- a/tests/test-convert-hg-svn.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-convert-hg-svn.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,8 +1,10 @@ #require svn svn-bindings - $ echo "[extensions]" >> $HGRCPATH - $ echo "convert = " >> $HGRCPATH - $ echo "mq = " >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > convert = + > mq = + > EOF $ SVNREPOPATH=`pwd`/svn-repo #if windows
--- a/tests/test-convert-tagsbranch-topology.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-convert-tagsbranch-topology.t Wed Nov 05 12:41:12 2014 -0600 @@ -4,11 +4,13 @@ $ echo "autocrlf = false" >> $HOME/.gitconfig $ echo "[core]" >> $HOME/.gitconfig $ echo "autocrlf = false" >> $HOME/.gitconfig - $ echo "[extensions]" >> $HGRCPATH - $ echo "convert=" >> $HGRCPATH - $ echo '[convert]' >> $HGRCPATH - $ echo 'hg.usebranchnames = True' >> $HGRCPATH - $ echo 'hg.tagsbranch = tags-update' >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > convert = + > [convert] + > hg.usebranchnames = True + > hg.tagsbranch = tags-update + > EOF $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
--- a/tests/test-diff-color.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-diff-color.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,9 +1,11 @@ Setup - $ echo "[color]" >> $HGRCPATH - $ echo "mode = ansi" >> $HGRCPATH - $ echo "[extensions]" >> $HGRCPATH - $ echo "color=" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [color] + > mode = ansi + > [extensions] + > color = + > EOF $ hg init repo $ cd repo $ cat > a <<EOF @@ -66,11 +68,13 @@ $ hg diff --stat --color=always a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc) 1 files changed, 1 insertions(+), 1 deletions(-) - $ echo "record=" >> $HGRCPATH - $ echo "[ui]" >> $HGRCPATH - $ echo "interactive=true" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "git=True" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > record = + > [ui] + > interactive = true + > [diff] + > git = True + > EOF #if execbit
--- a/tests/test-diff-upgrade.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-diff-upgrade.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,9 +1,11 @@ #require execbit - $ echo "[extensions]" >> $HGRCPATH - $ echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "nodates=1" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > autodiff = $TESTDIR/autodiff.py + > [diff] + > nodates = 1 + > EOF $ hg init repo $ cd repo
--- a/tests/test-eol.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-eol.t Wed Nov 05 12:41:12 2014 -0600 @@ -408,10 +408,12 @@ Test cleverencode: and cleverdecode: aliases for win32text extension - $ echo '[encode]' >> $HGRCPATH - $ echo '**.txt = cleverencode:' >> $HGRCPATH - $ echo '[decode]' >> $HGRCPATH - $ echo '**.txt = cleverdecode:' >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [encode] + > **.txt = cleverencode: + > [decode] + > **.txt = cleverdecode: + > EOF $ hg init win32compat $ cd win32compat
--- a/tests/test-eolfilename.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-eolfilename.t Wed Nov 05 12:41:12 2014 -0600 @@ -59,10 +59,12 @@ $ hg init bar $ cd bar - $ echo "[extensions]" >> $HGRCPATH - $ echo "color=" >> $HGRCPATH - $ echo "[color]" >> $HGRCPATH - $ echo "mode = ansi" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > color = + > [color] + > mode = ansi + > EOF $ A=`printf 'foo\nbar'` $ B=`printf 'foo\nbar.baz'` $ touch "$A"
--- a/tests/test-export.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-export.t Wed Nov 05 12:41:12 2014 -0600 @@ -176,10 +176,12 @@ [255] Check for color output - $ echo "[color]" >> $HGRCPATH - $ echo "mode = ansi" >> $HGRCPATH - $ echo "[extensions]" >> $HGRCPATH - $ echo "color=" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [color] + > mode = ansi + > [extensions] + > color = + > EOF $ hg export --color always --nodates tip # HG changeset patch
--- a/tests/test-extdiff.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-extdiff.t Wed Nov 05 12:41:12 2014 -0600 @@ -16,11 +16,13 @@ Only in a: b [1] - $ echo "[extdiff]" >> $HGRCPATH - $ echo "cmd.falabala=echo" >> $HGRCPATH - $ echo "opts.falabala=diffing" >> $HGRCPATH - $ echo "cmd.edspace=echo" >> $HGRCPATH - $ echo 'opts.edspace="name <user@example.com>"' >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extdiff] + > cmd.falabala = echo + > opts.falabala = diffing + > cmd.edspace = echo + > opts.edspace = "name <user@example.com>" + > EOF $ hg falabala diffing a.000000000000 a @@ -190,6 +192,26 @@ */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) [1] +Fallback to merge-tools.tool.executable|regkey + $ mkdir dir + $ cat > 'dir/tool.sh' << EOF + > #!/bin/sh + > echo "** custom diff **" + > EOF + $ chmod +x dir/tool.sh + $ tool=`pwd`/dir/tool.sh + $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool + making snapshot of 2 files from rev * (glob) + a + b + making snapshot of 2 files from working directory + a + b + running "'$TESTTMP/a/dir/tool.sh' 'a.*' 'a'" in */extdiff.* (glob) + ** custom diff ** + cleaning up temp directory + [1] + $ cd .. #endif
--- a/tests/test-extension.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-extension.t Wed Nov 05 12:41:12 2014 -0600 @@ -424,10 +424,9 @@ #cmd.cdiff = gdiff #opts.cdiff = -Nprc5 - # add new command called vdiff, runs kdiff3 - vdiff = kdiff3 - - # add new command called meld, runs meld (no need to name twice) + # add new command called meld, runs meld (no need to name twice). If + # the meld executable is not available, the meld tool in [merge-tools] + # will be used, if available meld = # add new command called vimdiff, runs gvimdiff with DirDiff plugin @@ -558,11 +557,13 @@ > "yet another debug command" > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()])) > EOF - $ echo "debugissue811 = $debugpath" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "strip=" >> $HGRCPATH - $ echo "hgext.mq=" >> $HGRCPATH - $ echo "hgext/mq=" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > debugissue811 = $debugpath + > mq = + > strip = + > hgext.mq = + > hgext/mq = + > EOF Show extensions: (note that mq force load strip, also checking it's not loaded twice) @@ -813,9 +814,11 @@ $ hg -q -R pull-src1 pull src reposetup() for $TESTTMP/reposetup-test/src (glob) - $ echo '[extensions]' >> $HGRCPATH - $ echo '# disable extension globally and explicitly' >> $HGRCPATH - $ echo 'reposetuptest = !' >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > # disable extension globally and explicitly + > reposetuptest = ! + > EOF $ hg clone -U src clone-dst2 reposetup() for $TESTTMP/reposetup-test/src (glob) $ hg init push-dst2 @@ -825,9 +828,11 @@ $ hg -q -R pull-src2 pull src reposetup() for $TESTTMP/reposetup-test/src (glob) - $ echo '[extensions]' >> $HGRCPATH - $ echo '# enable extension globally' >> $HGRCPATH - $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > # enable extension globally + > reposetuptest = $TESTTMP/reposetuptest.py + > EOF $ hg clone -U src clone-dst3 reposetup() for $TESTTMP/reposetup-test/src (glob) reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob) @@ -863,9 +868,11 @@ $ hg --config extensions.reposetuptest=! init pull-src5 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src - $ echo '[extensions]' >> $HGRCPATH - $ echo '# disable extension globally and explicitly' >> $HGRCPATH - $ echo 'reposetuptest = !' >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > # disable extension globally and explicitly + > reposetuptest = ! + > EOF $ hg init parent $ hg init parent/sub1 $ echo 1 > parent/sub1/1
--- a/tests/test-help.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-help.t Wed Nov 05 12:41:12 2014 -0600 @@ -272,7 +272,7 @@ schemes extend schemes with shortcuts to repository swarms share share a common history between several working directories shelve save and restore changes to the working directory - strip strip changesets and their descendents from history + strip strip changesets and their descendants from history transplant command to transplant changesets from another branch win32mbcs allow the use of MBCS paths with problematic encodings zeroconf discover and advertise repositories on the local network
--- a/tests/test-largefiles-misc.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-largefiles-misc.t Wed Nov 05 12:41:12 2014 -0600 @@ -589,7 +589,7 @@ 89e6c98d92887913cadf06b2adb97f26cde4849b -Pusing revision #1 causes uploading entity 89e6c98d9288, which is +Pushing revision #1 causes uploading entity 89e6c98d9288, which is shared also by largefiles b1, b2 in revision #2 and b in revision #5. Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg @@ -832,4 +832,33 @@ $ cd .. +Test "pull --rebase" when rebase is enabled before largefiles (issue3861) +========================================================================= + $ hg showconfig extensions | grep largefiles + extensions.largefiles=! + + $ mkdir issue3861 + $ cd issue3861 + $ hg init src + $ hg clone -q src dst + $ echo a > src/a + $ hg -R src commit -Aqm "#0" + Invoking status precommit hook + A a + + $ cat >> dst/.hg/hgrc <<EOF + > [extensions] + > largefiles= + > EOF + $ hg -R dst pull --rebase + pulling from $TESTTMP/issue3861/src (glob) + requesting all changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + nothing to rebase - working directory parent is already an ancestor of destination bf5e395ced2c + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + + $ cd ..
--- a/tests/test-largefiles-update.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-largefiles-update.t Wed Nov 05 12:41:12 2014 -0600 @@ -509,8 +509,25 @@ $ cat large1 large1 in #1 - $ hg rebase -q --abort - rebase aborted +Test that rebase updates standins for manually modified largefiles at +the 1st commit of resuming. + + $ echo "manually modified before 'hg rebase --continue'" > large1 + $ hg resolve -m normal1 + (no more unresolved files) + $ hg rebase --continue --config ui.interactive=True <<EOF + > c + > EOF + local changed .hglf/large1 which remote deleted + use (c)hanged version or (d)elete? c + + $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]' + -e5bb990443d6a92aaf7223813720f7566c9dd05b + +8a4f783556e7dea21139ca0466eafce954c75c13 + $ rm -f large1 + $ hg update -q -C tip + $ cat large1 + manually modified before 'hg rebase --continue' Test that transplant updates largefiles, of which standins are safely changed, even if it is aborted by conflict of other.
--- a/tests/test-largefiles-wireproto.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-largefiles-wireproto.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,5 +1,5 @@ -This file contains testcases that tend to be related to the wireprotocol part of -largefile. +This file contains testcases that tend to be related to the wire protocol part +of largefiles. $ USERCACHE="$TESTTMP/cache"; export USERCACHE $ mkdir "${USERCACHE}"
--- a/tests/test-largefiles.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-largefiles.t Wed Nov 05 12:41:12 2014 -0600 @@ -1172,12 +1172,11 @@ adding manifests adding file changes added 1 changesets with 2 changes to 2 files (+1 heads) + 0 largefiles cached Invoking status precommit hook M sub/normal4 M sub2/large6 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) - 0 largefiles cached - nothing to rebase - working directory parent is also destination $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 9:598410d3eb9a modify normal file largefile in repo d
--- a/tests/test-mq-eol.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-eol.t Wed Nov 05 12:41:12 2014 -0600 @@ -2,10 +2,12 @@ Test interactions between mq and patch.eol - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "nodates=1" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [diff] + > nodates = 1 + > EOF $ cat > makepatch.py <<EOF > f = file('eol.diff', 'wb')
--- a/tests/test-mq-git.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-git.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,10 +1,12 @@ # Test the plumbing of mq.git option # Automatic upgrade itself is tested elsewhere. - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "nodates=1" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [diff] + > nodates = 1 + > EOF $ hg init repo-auto $ cd repo-auto
--- a/tests/test-mq-guards.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-guards.t Wed Nov 05 12:41:12 2014 -0600 @@ -568,7 +568,7 @@ 3 G b.patch test that "qselect --reapply" checks applied patches correctly when no -applied patche becomes guarded but some of unapplied ones become +applied patches becomes guarded but some of unapplied ones become unguarded. $ hg qpop -q -a
--- a/tests/test-mq-header-date.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-header-date.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,8 +1,10 @@ - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "nodates=true" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [diff] + > nodates = true + > EOF $ catpatch() { > cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \ > -e "s/^\(# Parent \).*/\1/"
--- a/tests/test-mq-merge.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-merge.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,9 +1,11 @@ Setup extension: - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq =" >> $HGRCPATH - $ echo "[mq]" >> $HGRCPATH - $ echo "git = keep" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [mq] + > git = keep + > EOF Test merge with mq changeset as the second parent:
--- a/tests/test-mq-qdiff.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-qdiff.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,7 +1,9 @@ - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "[mq]" >> $HGRCPATH - $ echo "git=keep" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [mq] + > git = keep + > EOF $ hg init a $ cd a
--- a/tests/test-mq-qfold.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-qfold.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,9 +1,11 @@ - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "[mq]" >> $HGRCPATH - $ echo "git=keep" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "nodates=1" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [mq] + > git = keep + > [diff] + > nodates = 1 + > EOF init:
--- a/tests/test-mq-qimport.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-qimport.t Wed Nov 05 12:41:12 2014 -0600 @@ -15,10 +15,12 @@ > f.close() > > EOF - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "git=1" >> $HGRCPATH + > cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [diff] + > git = 1 + > EOF $ hg init repo $ cd repo
--- a/tests/test-mq-qrefresh.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-qrefresh.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,7 +1,9 @@ - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "nodates=1" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [diff] + > nodates = 1 + > EOF $ hg init a $ cd a
--- a/tests/test-mq-subrepo-svn.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-subrepo-svn.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,9 +1,11 @@ #require svn13 - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "nodates=1" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [diff] + > nodates = 1 + > EOF fn to create new repository, and cd into it $ mkrepo() {
--- a/tests/test-mq-subrepo.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq-subrepo.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,10 +1,12 @@ - $ echo "[ui]" >> $HGRCPATH - $ echo "commitsubrepos = Yes" >> $HGRCPATH - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "record=" >> $HGRCPATH - $ echo "[diff]" >> $HGRCPATH - $ echo "nodates=1" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [ui] + > commitsubrepos = Yes + > [extensions] + > mq = + > record = + > [diff] + > nodates = 1 + > EOF $ stdin=`pwd`/stdin.tmp
--- a/tests/test-mq.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-mq.t Wed Nov 05 12:41:12 2014 -0600 @@ -5,11 +5,12 @@ > fi > } - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - - $ echo "[mq]" >> $HGRCPATH - $ echo "plain=true" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > [mq] + > plain = true + > EOF help @@ -1582,7 +1583,7 @@ $ cd .. -Test interraction with revset (issue4426) +Test interaction with revset (issue4426) $ hg init issue4426 $ cd issue4426
--- a/tests/test-phases-exchange.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-phases-exchange.t Wed Nov 05 12:41:12 2014 -0600 @@ -755,7 +755,7 @@ Bare push with next changeset and common changeset needing sync (issue3575) -(reset some stat on remot repo to not confused other test) +(reset some stat on remote repo to avoid confusing other tests) $ hg -R ../alpha --config extensions.strip= strip --no-backup 967b449fbc94 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
--- a/tests/test-progress.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-progress.t Wed Nov 05 12:41:12 2014 -0600 @@ -296,7 +296,7 @@ \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 [=====> ]\r (no-eol) (esc) \r (no-eol) (esc) -test triming progress items, when they contain multi-byte characters, +test trimming progress items, when they contain multi-byte characters, of which length of byte sequence and columns in display are different from each other.
--- a/tests/test-record.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-record.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,9 +1,11 @@ Set up a repo - $ echo "[ui]" >> $HGRCPATH - $ echo "interactive=true" >> $HGRCPATH - $ echo "[extensions]" >> $HGRCPATH - $ echo "record=" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [ui] + > interactive = true + > [extensions] + > record = + > EOF $ hg init a $ cd a
--- a/tests/test-revert.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-revert.t Wed Nov 05 12:41:12 2014 -0600 @@ -398,157 +398,63 @@ Systematic behavior validation of most possible cases ===================================================== -This section tests most of the possible combinations of working directory -changes and inter-revision changes. The number of possible cases is significant -but they all have a slighly different handling. So this section commits to -generating and testing all of them to allow safe refactoring of the revert code. +This section tests most of the possible combinations of revision states and +working directory states. The number of possible cases is significant but they +but they all have a slightly different handling. So this section commits to +and testing all of them to allow safe refactoring of the revert code. A python script is used to generate a file history for each combination of -changes between, on one side the working directory and its parent and on -the other side, changes between a revert target (--rev) and working directory -parent. The three states generated are: +states, on one side the content (or lack thereof) in two revisions, and +on the other side, the content and "tracked-ness" of the working directory. The +three states generated are: - a "base" revision - a "parent" revision - the working directory (based on "parent") -The file generated have names of the form: +The files generated have names of the form: - <changeset-state>_<working-copy-state> - -Here, "changeset-state" conveys the state in "base" and "parent" (or the change -that happen between them), "working-copy-state" is self explanatory. + <rev1-content>_<rev2-content>_<working-copy-content>-<tracked-ness> All known states are not tested yet. See inline documentation for details. Special cases from merge and rename are not tested by this section. -There are also multiple cases where the current revert implementation is known to -slightly misbehave. - Write the python script to disk ------------------------------- - $ cat << EOF > gen-revert-cases.py - > # generate proper file state to test revert behavior - > import sys - > import os - > - > # content of the file in "base" and "parent" - > # None means no file at all - > ctxcontent = { - > # clean: no change from base to parent - > 'clean': ['base', 'base'], - > # modified: file content change from base to parent - > 'modified': ['base', 'parent'], - > # added: file is missing from base and added in parent - > 'added': [None, 'parent'], - > # removed: file exist in base but is removed from parent - > 'removed': ['base', None], - > # file exist neither in base not in parent - > 'missing': [None, None], - > } - > - > # content of file in working copy - > wccontent = { - > # clean: wc content is the same as parent - > 'clean': lambda cc: cc[1], - > # revert: wc content is the same as base - > 'revert': lambda cc: cc[0], - > # wc: file exist with a content different from base and parent - > 'wc': lambda cc: 'wc', - > # removed: file is missing and marked as untracked - > 'removed': lambda cc: None, - > # deleted: file is recorded as tracked but missing - > # rely on file deletion outside of this script - > 'deleted': lambda cc:'TOBEDELETED', - > } - > # untracked-X is a version of X where the file is not tracked (? unknown) - > wccontent['untracked-clean'] = wccontent['clean'] - > wccontent['untracked-revert'] = wccontent['revert'] - > wccontent['untracked-wc'] = wccontent['wc'] - > - > # build the combination of possible states - > combination = [] - > for ctxkey in ctxcontent: - > for wckey in wccontent: - > filename = "%s_%s" % (ctxkey, wckey) - > combination.append((filename, ctxkey, wckey)) - > - > # make sure we have stable output - > combination.sort() - > - > # retrieve the state we must generate - > target = sys.argv[1] - > - > # compute file content - > content = [] - > for filename, ctxkey, wckey in combination: - > cc = ctxcontent[ctxkey] - > if target == 'filelist': - > print filename - > elif target == 'base': - > content.append((filename, cc[0])) - > elif target == 'parent': - > content.append((filename, cc[1])) - > elif target == 'wc': - > content.append((filename, wccontent[wckey](cc))) - > else: - > print >> sys.stderr, "unknown target:", target - > sys.exit(1) - > - > # write actual content - > for filename, data in content: - > if data is not None: - > f = open(filename, 'w') - > f.write(data + '\n') - > f.close() - > elif os.path.exists(filename): - > os.remove(filename) - > EOF - check list of planned files - $ python gen-revert-cases.py filelist - added_clean - added_deleted - added_removed - added_revert - added_untracked-clean - added_untracked-revert - added_untracked-wc - added_wc - clean_clean - clean_deleted - clean_removed - clean_revert - clean_untracked-clean - clean_untracked-revert - clean_untracked-wc - clean_wc - missing_clean - missing_deleted - missing_removed - missing_revert - missing_untracked-clean - missing_untracked-revert - missing_untracked-wc - missing_wc - modified_clean - modified_deleted - modified_removed - modified_revert - modified_untracked-clean - modified_untracked-revert - modified_untracked-wc - modified_wc - removed_clean - removed_deleted - removed_removed - removed_revert - removed_untracked-clean - removed_untracked-revert - removed_untracked-wc - removed_wc + $ python $TESTDIR/generate-working-copy-states.py filelist + content1_content1_content1-tracked + content1_content1_content1-untracked + content1_content1_content3-tracked + content1_content1_content3-untracked + content1_content1_missing-tracked + content1_content1_missing-untracked + content1_content2_content1-tracked + content1_content2_content1-untracked + content1_content2_content2-tracked + content1_content2_content2-untracked + content1_content2_content3-tracked + content1_content2_content3-untracked + content1_content2_missing-tracked + content1_content2_missing-untracked + content1_missing_content1-tracked + content1_missing_content1-untracked + content1_missing_content3-tracked + content1_missing_content3-untracked + content1_missing_missing-tracked + content1_missing_missing-untracked + missing_content2_content2-tracked + missing_content2_content2-untracked + missing_content2_content3-tracked + missing_content2_content3-untracked + missing_content2_missing-tracked + missing_content2_missing-untracked + missing_missing_content3-tracked + missing_missing_content3-untracked + missing_missing_missing-tracked + missing_missing_missing-untracked Script to make a simple text version of the content --------------------------------------------------- @@ -573,268 +479,233 @@ Generate base changeset - $ python ../gen-revert-cases.py base + $ python $TESTDIR/generate-working-copy-states.py base $ hg addremove --similarity 0 - adding clean_clean - adding clean_deleted - adding clean_removed - adding clean_revert - adding clean_untracked-clean - adding clean_untracked-revert - adding clean_untracked-wc - adding clean_wc - adding modified_clean - adding modified_deleted - adding modified_removed - adding modified_revert - adding modified_untracked-clean - adding modified_untracked-revert - adding modified_untracked-wc - adding modified_wc - adding removed_clean - adding removed_deleted - adding removed_removed - adding removed_revert - adding removed_untracked-clean - adding removed_untracked-revert - adding removed_untracked-wc - adding removed_wc + adding content1_content1_content1-tracked + adding content1_content1_content1-untracked + adding content1_content1_content3-tracked + adding content1_content1_content3-untracked + adding content1_content1_missing-tracked + adding content1_content1_missing-untracked + adding content1_content2_content1-tracked + adding content1_content2_content1-untracked + adding content1_content2_content2-tracked + adding content1_content2_content2-untracked + adding content1_content2_content3-tracked + adding content1_content2_content3-untracked + adding content1_content2_missing-tracked + adding content1_content2_missing-untracked + adding content1_missing_content1-tracked + adding content1_missing_content1-untracked + adding content1_missing_content3-tracked + adding content1_missing_content3-untracked + adding content1_missing_missing-tracked + adding content1_missing_missing-untracked $ hg status - A clean_clean - A clean_deleted - A clean_removed - A clean_revert - A clean_untracked-clean - A clean_untracked-revert - A clean_untracked-wc - A clean_wc - A modified_clean - A modified_deleted - A modified_removed - A modified_revert - A modified_untracked-clean - A modified_untracked-revert - A modified_untracked-wc - A modified_wc - A removed_clean - A removed_deleted - A removed_removed - A removed_revert - A removed_untracked-clean - A removed_untracked-revert - A removed_untracked-wc - A removed_wc + A content1_content1_content1-tracked + A content1_content1_content1-untracked + A content1_content1_content3-tracked + A content1_content1_content3-untracked + A content1_content1_missing-tracked + A content1_content1_missing-untracked + A content1_content2_content1-tracked + A content1_content2_content1-untracked + A content1_content2_content2-tracked + A content1_content2_content2-untracked + A content1_content2_content3-tracked + A content1_content2_content3-untracked + A content1_content2_missing-tracked + A content1_content2_missing-untracked + A content1_missing_content1-tracked + A content1_missing_content1-untracked + A content1_missing_content3-tracked + A content1_missing_content3-untracked + A content1_missing_missing-tracked + A content1_missing_missing-untracked $ hg commit -m 'base' (create a simple text version of the content) $ python ../dircontent.py > ../content-base.txt $ cat ../content-base.txt - base clean_clean - base clean_deleted - base clean_removed - base clean_revert - base clean_untracked-clean - base clean_untracked-revert - base clean_untracked-wc - base clean_wc - base modified_clean - base modified_deleted - base modified_removed - base modified_revert - base modified_untracked-clean - base modified_untracked-revert - base modified_untracked-wc - base modified_wc - base removed_clean - base removed_deleted - base removed_removed - base removed_revert - base removed_untracked-clean - base removed_untracked-revert - base removed_untracked-wc - base removed_wc + content1 content1_content1_content1-tracked + content1 content1_content1_content1-untracked + content1 content1_content1_content3-tracked + content1 content1_content1_content3-untracked + content1 content1_content1_missing-tracked + content1 content1_content1_missing-untracked + content1 content1_content2_content1-tracked + content1 content1_content2_content1-untracked + content1 content1_content2_content2-tracked + content1 content1_content2_content2-untracked + content1 content1_content2_content3-tracked + content1 content1_content2_content3-untracked + content1 content1_content2_missing-tracked + content1 content1_content2_missing-untracked + content1 content1_missing_content1-tracked + content1 content1_missing_content1-untracked + content1 content1_missing_content3-tracked + content1 content1_missing_content3-untracked + content1 content1_missing_missing-tracked + content1 content1_missing_missing-untracked Create parent changeset - $ python ../gen-revert-cases.py parent + $ python $TESTDIR/generate-working-copy-states.py parent $ hg addremove --similarity 0 - adding added_clean - adding added_deleted - adding added_removed - adding added_revert - adding added_untracked-clean - adding added_untracked-revert - adding added_untracked-wc - adding added_wc - removing removed_clean - removing removed_deleted - removing removed_removed - removing removed_revert - removing removed_untracked-clean - removing removed_untracked-revert - removing removed_untracked-wc - removing removed_wc + removing content1_missing_content1-tracked + removing content1_missing_content1-untracked + removing content1_missing_content3-tracked + removing content1_missing_content3-untracked + removing content1_missing_missing-tracked + removing content1_missing_missing-untracked + adding missing_content2_content2-tracked + adding missing_content2_content2-untracked + adding missing_content2_content3-tracked + adding missing_content2_content3-untracked + adding missing_content2_missing-tracked + adding missing_content2_missing-untracked $ hg status - M modified_clean - M modified_deleted - M modified_removed - M modified_revert - M modified_untracked-clean - M modified_untracked-revert - M modified_untracked-wc - M modified_wc - A added_clean - A added_deleted - A added_removed - A added_revert - A added_untracked-clean - A added_untracked-revert - A added_untracked-wc - A added_wc - R removed_clean - R removed_deleted - R removed_removed - R removed_revert - R removed_untracked-clean - R removed_untracked-revert - R removed_untracked-wc - R removed_wc + M content1_content2_content1-tracked + M content1_content2_content1-untracked + M content1_content2_content2-tracked + M content1_content2_content2-untracked + M content1_content2_content3-tracked + M content1_content2_content3-untracked + M content1_content2_missing-tracked + M content1_content2_missing-untracked + A missing_content2_content2-tracked + A missing_content2_content2-untracked + A missing_content2_content3-tracked + A missing_content2_content3-untracked + A missing_content2_missing-tracked + A missing_content2_missing-untracked + R content1_missing_content1-tracked + R content1_missing_content1-untracked + R content1_missing_content3-tracked + R content1_missing_content3-untracked + R content1_missing_missing-tracked + R content1_missing_missing-untracked $ hg commit -m 'parent' (create a simple text version of the content) $ python ../dircontent.py > ../content-parent.txt $ cat ../content-parent.txt - parent added_clean - parent added_deleted - parent added_removed - parent added_revert - parent added_untracked-clean - parent added_untracked-revert - parent added_untracked-wc - parent added_wc - base clean_clean - base clean_deleted - base clean_removed - base clean_revert - base clean_untracked-clean - base clean_untracked-revert - base clean_untracked-wc - base clean_wc - parent modified_clean - parent modified_deleted - parent modified_removed - parent modified_revert - parent modified_untracked-clean - parent modified_untracked-revert - parent modified_untracked-wc - parent modified_wc + content1 content1_content1_content1-tracked + content1 content1_content1_content1-untracked + content1 content1_content1_content3-tracked + content1 content1_content1_content3-untracked + content1 content1_content1_missing-tracked + content1 content1_content1_missing-untracked + content2 content1_content2_content1-tracked + content2 content1_content2_content1-untracked + content2 content1_content2_content2-tracked + content2 content1_content2_content2-untracked + content2 content1_content2_content3-tracked + content2 content1_content2_content3-untracked + content2 content1_content2_missing-tracked + content2 content1_content2_missing-untracked + content2 missing_content2_content2-tracked + content2 missing_content2_content2-untracked + content2 missing_content2_content3-tracked + content2 missing_content2_content3-untracked + content2 missing_content2_missing-tracked + content2 missing_content2_missing-untracked Setup working directory - $ python ../gen-revert-cases.py wc | cat + $ python $TESTDIR/generate-working-copy-states.py wc $ hg addremove --similarity 0 - removing added_removed - removing added_revert - removing added_untracked-revert - removing clean_removed - adding missing_deleted - adding missing_untracked-wc - adding missing_wc - removing modified_removed - adding removed_deleted - adding removed_revert - adding removed_untracked-revert - adding removed_untracked-wc - adding removed_wc - $ hg forget *untracked* - $ rm *deleted* + adding content1_missing_content1-tracked + adding content1_missing_content1-untracked + adding content1_missing_content3-tracked + adding content1_missing_content3-untracked + adding content1_missing_missing-tracked + adding content1_missing_missing-untracked + adding missing_missing_content3-tracked + adding missing_missing_content3-untracked + adding missing_missing_missing-tracked + adding missing_missing_missing-untracked + $ hg forget *_*_*-untracked + $ rm *_*_missing-* $ hg status - M added_wc - M clean_wc - M modified_revert - M modified_wc - A missing_wc - A removed_revert - A removed_wc - R added_removed - R added_revert - R added_untracked-clean - R added_untracked-revert - R added_untracked-wc - R clean_removed - R clean_untracked-clean - R clean_untracked-revert - R clean_untracked-wc - R modified_removed - R modified_untracked-clean - R modified_untracked-revert - R modified_untracked-wc - ! added_deleted - ! clean_deleted - ! missing_deleted - ! modified_deleted - ! removed_deleted - ? missing_untracked-wc - ? removed_untracked-revert - ? removed_untracked-wc + M content1_content1_content3-tracked + M content1_content2_content1-tracked + M content1_content2_content3-tracked + M missing_content2_content3-tracked + A content1_missing_content1-tracked + A content1_missing_content3-tracked + A missing_missing_content3-tracked + R content1_content1_content1-untracked + R content1_content1_content3-untracked + R content1_content1_missing-untracked + R content1_content2_content1-untracked + R content1_content2_content2-untracked + R content1_content2_content3-untracked + R content1_content2_missing-untracked + R missing_content2_content2-untracked + R missing_content2_content3-untracked + R missing_content2_missing-untracked + ! content1_content1_missing-tracked + ! content1_content2_missing-tracked + ! content1_missing_missing-tracked + ! missing_content2_missing-tracked + ! missing_missing_missing-tracked + ? content1_missing_content1-untracked + ? content1_missing_content3-untracked + ? missing_missing_content3-untracked $ hg status --rev 'desc("base")' - M clean_wc - M modified_clean - M modified_wc - M removed_wc - A added_clean - A added_wc - A missing_wc - R clean_removed - R clean_untracked-clean - R clean_untracked-revert - R clean_untracked-wc - R modified_removed - R modified_untracked-clean - R modified_untracked-revert - R modified_untracked-wc - R removed_clean - R removed_deleted - R removed_removed - R removed_untracked-clean - R removed_untracked-revert - R removed_untracked-wc - ! added_deleted - ! clean_deleted - ! missing_deleted - ! modified_deleted - ! removed_deleted - ? missing_untracked-wc + M content1_content1_content3-tracked + M content1_content2_content2-tracked + M content1_content2_content3-tracked + M content1_missing_content3-tracked + A missing_content2_content2-tracked + A missing_content2_content3-tracked + A missing_missing_content3-tracked + R content1_content1_content1-untracked + R content1_content1_content3-untracked + R content1_content1_missing-untracked + R content1_content2_content1-untracked + R content1_content2_content2-untracked + R content1_content2_content3-untracked + R content1_content2_missing-untracked + R content1_missing_content1-untracked + R content1_missing_content3-untracked + R content1_missing_missing-tracked + R content1_missing_missing-untracked + ! content1_content1_missing-tracked + ! content1_content2_missing-tracked + ! content1_missing_missing-tracked + ! missing_content2_missing-tracked + ! missing_missing_missing-tracked + ? missing_missing_content3-untracked (create a simple text version of the content) $ python ../dircontent.py > ../content-wc.txt $ cat ../content-wc.txt - parent added_clean - parent added_untracked-clean - wc added_untracked-wc - wc added_wc - base clean_clean - base clean_revert - base clean_untracked-clean - base clean_untracked-revert - wc clean_untracked-wc - wc clean_wc - wc missing_untracked-wc - wc missing_wc - parent modified_clean - base modified_revert - parent modified_untracked-clean - base modified_untracked-revert - wc modified_untracked-wc - wc modified_wc - base removed_revert - base removed_untracked-revert - wc removed_untracked-wc - wc removed_wc + content1 content1_content1_content1-tracked + content1 content1_content1_content1-untracked + content3 content1_content1_content3-tracked + content3 content1_content1_content3-untracked + content1 content1_content2_content1-tracked + content1 content1_content2_content1-untracked + content2 content1_content2_content2-tracked + content2 content1_content2_content2-untracked + content3 content1_content2_content3-tracked + content3 content1_content2_content3-untracked + content1 content1_missing_content1-tracked + content1 content1_missing_content1-untracked + content3 content1_missing_content3-tracked + content3 content1_missing_content3-untracked + content2 missing_content2_content2-tracked + content2 missing_content2_content2-untracked + content3 missing_content2_content3-tracked + content3 missing_content2_content3-untracked + content3 missing_missing_content3-tracked + content3 missing_missing_content3-untracked $ cd .. @@ -849,31 +720,28 @@ check revert output $ hg revert --all - reverting added_deleted - undeleting added_removed - undeleting added_revert - undeleting added_untracked-clean - undeleting added_untracked-revert - undeleting added_untracked-wc - reverting added_wc - reverting clean_deleted - undeleting clean_removed - undeleting clean_untracked-clean - undeleting clean_untracked-revert - undeleting clean_untracked-wc - reverting clean_wc - forgetting missing_deleted - forgetting missing_wc - reverting modified_deleted - undeleting modified_removed - reverting modified_revert - undeleting modified_untracked-clean - undeleting modified_untracked-revert - undeleting modified_untracked-wc - reverting modified_wc - forgetting removed_deleted - forgetting removed_revert - forgetting removed_wc + undeleting content1_content1_content1-untracked + reverting content1_content1_content3-tracked + undeleting content1_content1_content3-untracked + reverting content1_content1_missing-tracked + undeleting content1_content1_missing-untracked + reverting content1_content2_content1-tracked + undeleting content1_content2_content1-untracked + undeleting content1_content2_content2-untracked + reverting content1_content2_content3-tracked + undeleting content1_content2_content3-untracked + reverting content1_content2_missing-tracked + undeleting content1_content2_missing-untracked + forgetting content1_missing_content1-tracked + forgetting content1_missing_content3-tracked + forgetting content1_missing_missing-tracked + undeleting missing_content2_content2-untracked + reverting missing_content2_content3-tracked + undeleting missing_content2_content3-untracked + reverting missing_content2_missing-tracked + undeleting missing_content2_missing-untracked + forgetting missing_missing_content3-tracked + forgetting missing_missing_missing-tracked Compare resulting directory with revert target. @@ -883,20 +751,20 @@ $ python ../dircontent.py > ../content-parent-all.txt $ cd .. $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _ - +wc added_untracked-wc.orig - +wc added_wc.orig - +wc clean_untracked-wc.orig - +wc clean_wc.orig - +wc missing_untracked-wc - +wc missing_wc - +base modified_revert.orig - +base modified_untracked-revert.orig - +wc modified_untracked-wc.orig - +wc modified_wc.orig - +base removed_revert - +base removed_untracked-revert - +wc removed_untracked-wc - +wc removed_wc + +content3 content1_content1_content3-tracked.orig + +content3 content1_content1_content3-untracked.orig + +content1 content1_content2_content1-tracked.orig + +content1 content1_content2_content1-untracked.orig + +content3 content1_content2_content3-tracked.orig + +content3 content1_content2_content3-untracked.orig + +content1 content1_missing_content1-tracked + +content1 content1_missing_content1-untracked + +content3 content1_missing_content3-tracked + +content3 content1_missing_content3-untracked + +content3 missing_content2_content3-tracked.orig + +content3 missing_content2_content3-untracked.orig + +content3 missing_missing_content3-tracked + +content3 missing_missing_content3-untracked Test revert --all to "base" content ----------------------------------- @@ -909,31 +777,28 @@ check revert output $ hg revert --all --rev 'desc(base)' - removing added_clean - removing added_deleted - removing added_wc - reverting clean_deleted - undeleting clean_removed - undeleting clean_untracked-clean - undeleting clean_untracked-revert - undeleting clean_untracked-wc - reverting clean_wc - forgetting missing_deleted - forgetting missing_wc - reverting modified_clean - reverting modified_deleted - undeleting modified_removed - undeleting modified_untracked-clean - undeleting modified_untracked-revert - undeleting modified_untracked-wc - reverting modified_wc - adding removed_clean - reverting removed_deleted - adding removed_removed - adding removed_untracked-clean - adding removed_untracked-revert - adding removed_untracked-wc - reverting removed_wc + undeleting content1_content1_content1-untracked + reverting content1_content1_content3-tracked + undeleting content1_content1_content3-untracked + reverting content1_content1_missing-tracked + undeleting content1_content1_missing-untracked + undeleting content1_content2_content1-untracked + reverting content1_content2_content2-tracked + undeleting content1_content2_content2-untracked + reverting content1_content2_content3-tracked + undeleting content1_content2_content3-untracked + reverting content1_content2_missing-tracked + undeleting content1_content2_missing-untracked + adding content1_missing_content1-untracked + reverting content1_missing_content3-tracked + adding content1_missing_content3-untracked + reverting content1_missing_missing-tracked + adding content1_missing_missing-untracked + removing missing_content2_content2-tracked + removing missing_content2_content3-tracked + removing missing_content2_missing-tracked + forgetting missing_missing_content3-tracked + forgetting missing_missing_missing-tracked Compare resulting directory with revert target. @@ -943,18 +808,18 @@ $ python ../dircontent.py > ../content-base-all.txt $ cd .. $ diff -U 0 -- content-base.txt content-base-all.txt | grep _ - +parent added_untracked-clean - +wc added_untracked-wc - +wc added_wc.orig - +wc clean_untracked-wc.orig - +wc clean_wc.orig - +wc missing_untracked-wc - +wc missing_wc - +parent modified_untracked-clean.orig - +wc modified_untracked-wc.orig - +wc modified_wc.orig - +wc removed_untracked-wc.orig - +wc removed_wc.orig + +content3 content1_content1_content3-tracked.orig + +content3 content1_content1_content3-untracked.orig + +content2 content1_content2_content2-untracked.orig + +content3 content1_content2_content3-tracked.orig + +content3 content1_content2_content3-untracked.orig + +content3 content1_missing_content3-tracked.orig + +content3 content1_missing_content3-untracked.orig + +content2 missing_content2_content2-untracked + +content3 missing_content2_content3-tracked.orig + +content3 missing_content2_content3-untracked + +content3 missing_missing_content3-tracked + +content3 missing_missing_content3-untracked Test revert to parent content with explicit file name ----------------------------------------------------- @@ -967,108 +832,81 @@ revert all files individually and check the output (output is expected to be different than in the --all case) - $ for file in `python ../gen-revert-cases.py filelist`; do + $ for file in `python $TESTDIR/generate-working-copy-states.py filelist`; do > echo '### revert for:' $file; > hg revert $file; > echo > done - ### revert for: added_clean - no changes needed to added_clean - - ### revert for: added_deleted + ### revert for: content1_content1_content1-tracked + no changes needed to content1_content1_content1-tracked - ### revert for: added_removed + ### revert for: content1_content1_content1-untracked - ### revert for: added_revert - - ### revert for: added_untracked-clean + ### revert for: content1_content1_content3-tracked - ### revert for: added_untracked-revert + ### revert for: content1_content1_content3-untracked - ### revert for: added_untracked-wc + ### revert for: content1_content1_missing-tracked - ### revert for: added_wc + ### revert for: content1_content1_missing-untracked - ### revert for: clean_clean - no changes needed to clean_clean - - ### revert for: clean_deleted + ### revert for: content1_content2_content1-tracked - ### revert for: clean_removed - - ### revert for: clean_revert - no changes needed to clean_revert + ### revert for: content1_content2_content1-untracked - ### revert for: clean_untracked-clean + ### revert for: content1_content2_content2-tracked + no changes needed to content1_content2_content2-tracked - ### revert for: clean_untracked-revert - - ### revert for: clean_untracked-wc + ### revert for: content1_content2_content2-untracked - ### revert for: clean_wc + ### revert for: content1_content2_content3-tracked - ### revert for: missing_clean - missing_clean: no such file in rev * (glob) + ### revert for: content1_content2_content3-untracked - ### revert for: missing_deleted + ### revert for: content1_content2_missing-tracked - ### revert for: missing_removed - missing_removed: no such file in rev * (glob) + ### revert for: content1_content2_missing-untracked - ### revert for: missing_revert - missing_revert: no such file in rev * (glob) + ### revert for: content1_missing_content1-tracked - ### revert for: missing_untracked-clean - missing_untracked-clean: no such file in rev * (glob) + ### revert for: content1_missing_content1-untracked + file not managed: content1_missing_content1-untracked - ### revert for: missing_untracked-revert - missing_untracked-revert: no such file in rev * (glob) + ### revert for: content1_missing_content3-tracked - ### revert for: missing_untracked-wc - file not managed: missing_untracked-wc - - ### revert for: missing_wc + ### revert for: content1_missing_content3-untracked + file not managed: content1_missing_content3-untracked - ### revert for: modified_clean - no changes needed to modified_clean + ### revert for: content1_missing_missing-tracked - ### revert for: modified_deleted + ### revert for: content1_missing_missing-untracked + content1_missing_missing-untracked: no such file in rev * (glob) - ### revert for: modified_removed - - ### revert for: modified_revert + ### revert for: missing_content2_content2-tracked + no changes needed to missing_content2_content2-tracked - ### revert for: modified_untracked-clean - - ### revert for: modified_untracked-revert + ### revert for: missing_content2_content2-untracked - ### revert for: modified_untracked-wc + ### revert for: missing_content2_content3-tracked - ### revert for: modified_wc + ### revert for: missing_content2_content3-untracked - ### revert for: removed_clean - removed_clean: no such file in rev * (glob) + ### revert for: missing_content2_missing-tracked - ### revert for: removed_deleted - - ### revert for: removed_removed - removed_removed: no such file in rev * (glob) + ### revert for: missing_content2_missing-untracked - ### revert for: removed_revert + ### revert for: missing_missing_content3-tracked - ### revert for: removed_untracked-clean - removed_untracked-clean: no such file in rev * (glob) + ### revert for: missing_missing_content3-untracked + file not managed: missing_missing_content3-untracked - ### revert for: removed_untracked-revert - file not managed: removed_untracked-revert + ### revert for: missing_missing_missing-tracked - ### revert for: removed_untracked-wc - file not managed: removed_untracked-wc - - ### revert for: removed_wc + ### revert for: missing_missing_missing-untracked + missing_missing_missing-untracked: no such file in rev * (glob) -check resulting directory againt the --all run +check resulting directory against the --all run (There should be no difference) $ python ../dircontent.py > ../content-parent-explicit.txt @@ -1087,108 +925,81 @@ revert all files individually and check the output (output is expected to be different than in the --all case) - $ for file in `python ../gen-revert-cases.py filelist`; do + $ for file in `python $TESTDIR/generate-working-copy-states.py filelist`; do > echo '### revert for:' $file; > hg revert $file --rev 'desc(base)'; > echo > done - ### revert for: added_clean - - ### revert for: added_deleted + ### revert for: content1_content1_content1-tracked + no changes needed to content1_content1_content1-tracked - ### revert for: added_removed - no changes needed to added_removed + ### revert for: content1_content1_content1-untracked - ### revert for: added_revert - no changes needed to added_revert + ### revert for: content1_content1_content3-tracked - ### revert for: added_untracked-clean - no changes needed to added_untracked-clean + ### revert for: content1_content1_content3-untracked + + ### revert for: content1_content1_missing-tracked - ### revert for: added_untracked-revert - no changes needed to added_untracked-revert + ### revert for: content1_content1_missing-untracked - ### revert for: added_untracked-wc - no changes needed to added_untracked-wc - - ### revert for: added_wc + ### revert for: content1_content2_content1-tracked + no changes needed to content1_content2_content1-tracked - ### revert for: clean_clean - no changes needed to clean_clean + ### revert for: content1_content2_content1-untracked - ### revert for: clean_deleted + ### revert for: content1_content2_content2-tracked - ### revert for: clean_removed + ### revert for: content1_content2_content2-untracked - ### revert for: clean_revert - no changes needed to clean_revert - - ### revert for: clean_untracked-clean + ### revert for: content1_content2_content3-tracked - ### revert for: clean_untracked-revert + ### revert for: content1_content2_content3-untracked - ### revert for: clean_untracked-wc - - ### revert for: clean_wc + ### revert for: content1_content2_missing-tracked - ### revert for: missing_clean - missing_clean: no such file in rev * (glob) + ### revert for: content1_content2_missing-untracked - ### revert for: missing_deleted - - ### revert for: missing_removed - missing_removed: no such file in rev * (glob) + ### revert for: content1_missing_content1-tracked + no changes needed to content1_missing_content1-tracked - ### revert for: missing_revert - missing_revert: no such file in rev * (glob) + ### revert for: content1_missing_content1-untracked + + ### revert for: content1_missing_content3-tracked - ### revert for: missing_untracked-clean - missing_untracked-clean: no such file in rev * (glob) + ### revert for: content1_missing_content3-untracked - ### revert for: missing_untracked-revert - missing_untracked-revert: no such file in rev * (glob) + ### revert for: content1_missing_missing-tracked - ### revert for: missing_untracked-wc - file not managed: missing_untracked-wc + ### revert for: content1_missing_missing-untracked - ### revert for: missing_wc - - ### revert for: modified_clean + ### revert for: missing_content2_content2-tracked - ### revert for: modified_deleted + ### revert for: missing_content2_content2-untracked + no changes needed to missing_content2_content2-untracked - ### revert for: modified_removed - - ### revert for: modified_revert - no changes needed to modified_revert + ### revert for: missing_content2_content3-tracked - ### revert for: modified_untracked-clean - - ### revert for: modified_untracked-revert - - ### revert for: modified_untracked-wc + ### revert for: missing_content2_content3-untracked + no changes needed to missing_content2_content3-untracked - ### revert for: modified_wc + ### revert for: missing_content2_missing-tracked - ### revert for: removed_clean - - ### revert for: removed_deleted + ### revert for: missing_content2_missing-untracked + no changes needed to missing_content2_missing-untracked - ### revert for: removed_removed + ### revert for: missing_missing_content3-tracked - ### revert for: removed_revert - no changes needed to removed_revert + ### revert for: missing_missing_content3-untracked + file not managed: missing_missing_content3-untracked - ### revert for: removed_untracked-clean - - ### revert for: removed_untracked-revert + ### revert for: missing_missing_missing-tracked - ### revert for: removed_untracked-wc - - ### revert for: removed_wc + ### revert for: missing_missing_missing-untracked + missing_missing_missing-untracked: no such file in rev * (glob) -check resulting directory againt the --all run +check resulting directory against the --all run (There should be no difference) $ python ../dircontent.py > ../content-base-explicit.txt
--- a/tests/test-shelve.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-shelve.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,9 +1,11 @@ - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - $ echo "shelve=" >> $HGRCPATH - $ echo "[defaults]" >> $HGRCPATH - $ echo "diff = --nodates --git" >> $HGRCPATH - $ echo "qnew = --date '0 0'" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > mq = + > shelve = + > [defaults] + > diff = --nodates --git + > qnew = --date '0 0' + > EOF $ hg init repo $ cd repo
--- a/tests/test-status-color.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-status-color.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,7 +1,9 @@ - $ echo "[extensions]" >> $HGRCPATH - $ echo "color=" >> $HGRCPATH - $ echo "[color]" >> $HGRCPATH - $ echo "mode=ansi" >> $HGRCPATH + $ cat <<EOF >> $HGRCPATH + > [extensions] + > color = + > [color] + > mode = ansi + > EOF Terminfo codes compatibility fix $ echo "color.none=0" >> $HGRCPATH
--- a/tests/test-status-rev.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-status-rev.t Wed Nov 05 12:41:12 2014 -0600 @@ -1,156 +1,146 @@ Tests of 'hg status --rev <rev>' to make sure status between <rev> and '.' get combined correctly with the dirstate status. -Sets up a history for a number of files where the filename describes the file's -history. The first two letters of the filename describe the first two commits; -the third letter describes the dirstate for the file. For example, a file called -'amr' was added in the first commit, modified in the second and then removed in -the dirstate. - -These codes are used for commits: -x: does not exist -a: added -c: clean -m: modified -r: removed - -These codes are used for dirstate: -d: in dirstate, but deleted from disk -f: removed from dirstate, but file exists (forgotten) -r: removed from dirstate and disk -q: added, but deleted from disk (q for q-rious?) -u: not in dirstate, but file exists (unknown) - $ hg init $ touch .hgignore $ hg add .hgignore $ hg commit -m initial -First letter: first commit +First commit - $ echo a >acc - $ echo a >acd - $ echo a >acf - $ echo a >acm - $ echo a >acr - $ echo a >amc - $ echo a >amd - $ echo a >amf - $ echo a >amm - $ echo a >amr - $ echo a >ara - $ echo a >arq - $ echo a >aru - $ hg commit -Aqm first + $ python $TESTDIR/generate-working-copy-states.py base + $ hg addremove --similarity 0 + adding content1_content1_content1-tracked + adding content1_content1_content1-untracked + adding content1_content1_content3-tracked + adding content1_content1_content3-untracked + adding content1_content1_missing-tracked + adding content1_content1_missing-untracked + adding content1_content2_content1-tracked + adding content1_content2_content1-untracked + adding content1_content2_content2-tracked + adding content1_content2_content2-untracked + adding content1_content2_content3-tracked + adding content1_content2_content3-untracked + adding content1_content2_missing-tracked + adding content1_content2_missing-untracked + adding content1_missing_content1-tracked + adding content1_missing_content1-untracked + adding content1_missing_content3-tracked + adding content1_missing_content3-untracked + adding content1_missing_missing-tracked + adding content1_missing_missing-untracked + $ hg commit -m first -Second letter: second commit +Second commit - $ echo b >xad - $ echo b >xaf - $ echo b >xam - $ echo b >xar - $ echo b >amc - $ echo b >amd - $ echo b >amf - $ echo b >amm - $ echo b >amr - $ hg rm ara - $ hg rm arq - $ hg rm aru - $ hg commit -Aqm second - -Third letter: dirstate + $ python $TESTDIR/generate-working-copy-states.py parent + $ hg addremove --similarity 0 + removing content1_missing_content1-tracked + removing content1_missing_content1-untracked + removing content1_missing_content3-tracked + removing content1_missing_content3-untracked + removing content1_missing_missing-tracked + removing content1_missing_missing-untracked + adding missing_content2_content2-tracked + adding missing_content2_content2-untracked + adding missing_content2_content3-tracked + adding missing_content2_content3-untracked + adding missing_content2_missing-tracked + adding missing_content2_missing-untracked + $ hg commit -m second - $ echo c >acm - $ echo c >amm - $ echo c >xam - $ echo c >ara && hg add ara - $ echo c >arq && hg add arq && rm arq - $ echo c >aru - $ hg rm amr - $ hg rm acr - $ hg rm xar - $ rm acd - $ rm amd - $ rm xad - $ hg forget acf - $ hg forget amf - $ hg forget xaf - $ touch xxu +Working copy + + $ python $TESTDIR/generate-working-copy-states.py wc + $ hg addremove --similarity 0 + adding content1_missing_content1-tracked + adding content1_missing_content1-untracked + adding content1_missing_content3-tracked + adding content1_missing_content3-untracked + adding content1_missing_missing-tracked + adding content1_missing_missing-untracked + adding missing_missing_content3-tracked + adding missing_missing_content3-untracked + adding missing_missing_missing-tracked + adding missing_missing_missing-untracked + $ hg forget *_*_*-untracked + $ rm *_*_missing-* Status compared to one revision back - $ hg status -A --rev 1 acc - C acc + $ hg status -A --rev 1 content1_content1_content1-tracked + C content1_content1_content1-tracked BROKEN: file appears twice; should be '!' - $ hg status -A --rev 1 acd - ! acd - C acd - $ hg status -A --rev 1 acf - R acf - $ hg status -A --rev 1 acm - M acm - $ hg status -A --rev 1 acr - R acr - $ hg status -A --rev 1 amc - M amc + $ hg status -A --rev 1 content1_content1_missing-tracked + ! content1_content1_missing-tracked + C content1_content1_missing-tracked + $ hg status -A --rev 1 content1_content1_content1-untracked + R content1_content1_content1-untracked + $ hg status -A --rev 1 content1_content1_content3-tracked + M content1_content1_content3-tracked + $ hg status -A --rev 1 content1_content1_missing-untracked + R content1_content1_missing-untracked + $ hg status -A --rev 1 content1_content2_content2-tracked + M content1_content2_content2-tracked BROKEN: file appears twice; should be '!' - $ hg status -A --rev 1 amd - ! amd - C amd - $ hg status -A --rev 1 amf - R amf - $ hg status -A --rev 1 amm - M amm - $ hg status -A --rev 1 amr - R amr - $ hg status -A --rev 1 ara - M ara + $ hg status -A --rev 1 content1_content2_missing-tracked + ! content1_content2_missing-tracked + C content1_content2_missing-tracked + $ hg status -A --rev 1 content1_content2_content2-untracked + R content1_content2_content2-untracked + $ hg status -A --rev 1 content1_content2_content3-tracked + M content1_content2_content3-tracked + $ hg status -A --rev 1 content1_content2_missing-untracked + R content1_content2_missing-untracked + $ hg status -A --rev 1 content1_missing_content3-tracked + M content1_missing_content3-tracked BROKEN: file appears twice; should be '!' - $ hg status -A --rev 1 arq - R arq - ! arq - $ hg status -A --rev 1 aru - R aru - $ hg status -A --rev 1 xad - ! xad - $ hg status -A --rev 1 xaf - $ hg status -A --rev 1 xam - A xam - $ hg status -A --rev 1 xar - $ hg status -A --rev 1 xxu - ? xxu + $ hg status -A --rev 1 content1_missing_missing-tracked + R content1_missing_missing-tracked + ! content1_missing_missing-tracked + $ hg status -A --rev 1 content1_missing_content3-untracked + R content1_missing_content3-untracked + $ hg status -A --rev 1 missing_content2_missing-tracked + ! missing_content2_missing-tracked +BROKEN: file exists, so should be listed (as '?') + $ hg status -A --rev 1 missing_content2_content2-untracked + $ hg status -A --rev 1 missing_content2_content3-tracked + A missing_content2_content3-tracked + $ hg status -A --rev 1 missing_content2_missing-untracked + $ hg status -A --rev 1 missing_missing_content3-untracked + ? missing_missing_content3-untracked Status compared to two revisions back - $ hg status -A --rev 0 acc - A acc - $ hg status -A --rev 0 acd - ! acd + $ hg status -A --rev 0 content1_content1_content1-tracked + A content1_content1_content1-tracked + $ hg status -A --rev 0 content1_content1_missing-tracked + ! content1_content1_missing-tracked BROKEN: file exists, so should be listed (as '?') - $ hg status -A --rev 0 acf - $ hg status -A --rev 0 acm - A acm - $ hg status -A --rev 0 acr - $ hg status -A --rev 0 amc - A amc - $ hg status -A --rev 0 amd - ! amd + $ hg status -A --rev 0 content1_content1_content1-untracked + $ hg status -A --rev 0 content1_content1_content3-tracked + A content1_content1_content3-tracked + $ hg status -A --rev 0 content1_content1_missing-untracked + $ hg status -A --rev 0 content1_content2_content2-tracked + A content1_content2_content2-tracked + $ hg status -A --rev 0 content1_content2_missing-tracked + ! content1_content2_missing-tracked BROKEN: file exists, so should be listed (as '?') - $ hg status -A --rev 0 amf - $ hg status -A --rev 0 amm - A amm - $ hg status -A --rev 0 amr - $ hg status -A --rev 0 ara - A ara - $ hg status -A --rev 0 arq - ! arq - $ hg status -A --rev 0 aru - ? aru - $ hg status -A --rev 0 xad - ! xad + $ hg status -A --rev 0 content1_content2_content2-untracked + $ hg status -A --rev 0 content1_content2_content3-tracked + A content1_content2_content3-tracked + $ hg status -A --rev 0 content1_content2_missing-untracked + $ hg status -A --rev 0 content1_missing_content3-tracked + A content1_missing_content3-tracked + $ hg status -A --rev 0 content1_missing_missing-tracked + ! content1_missing_missing-tracked + $ hg status -A --rev 0 content1_missing_content3-untracked + ? content1_missing_content3-untracked + $ hg status -A --rev 0 missing_content2_missing-tracked + ! missing_content2_missing-tracked BROKEN: file exists, so should be listed (as '?') - $ hg status -A --rev 0 xaf - $ hg status -A --rev 0 xam - A xam - $ hg status -A --rev 0 xar + $ hg status -A --rev 0 missing_content2_content2-untracked + $ hg status -A --rev 0 missing_content2_content3-tracked + A missing_content2_content3-tracked + $ hg status -A --rev 0 missing_content2_missing-untracked
--- a/tests/test-tag.t Wed Nov 05 17:25:00 2014 +0000 +++ b/tests/test-tag.t Wed Nov 05 12:41:12 2014 -0600 @@ -479,7 +479,7 @@ 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 -check that the merge tried to minimize the diff witht he first merge parent +check that the merge tried to minimize the diff with the first merge parent $ hg diff --git -r 'p1()' .hgtags diff --git a/.hgtags b/.hgtags