Mercurial > hg
changeset 16518:80d940066176 stable
merge with i18n
author | Wagner Bruna <wbruna@yahoo.com> |
---|---|
date | Tue, 24 Apr 2012 20:54:56 -0300 |
parents | e3c7ca15cde2 (diff) 63e24ec0ef8b (current diff) |
children | 9c196f38f9f5 |
files | |
diffstat | 36 files changed, 176 insertions(+), 179 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Tue Apr 24 10:06:17 2012 -0300 +++ b/contrib/check-code.py Tue Apr 24 20:54:56 2012 -0300 @@ -43,7 +43,7 @@ testpats = [ [ - (r'(pushd|popd)', "don't use 'pushd' or 'popd', use 'cd'"), + (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"), (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), (r'^function', "don't use 'function', use old style"), (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"), @@ -55,7 +55,7 @@ (r'head -c', "don't use 'head -c', use 'dd'"), (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"), (r'ls.*-\w*R', "don't use 'ls -R', use 'find'"), - (r'printf.*\\\d{1,3}', "don't use 'printf \NNN', use Python"), + (r'printf.*\\([1-9]|0\d)', "don't use 'printf \NNN', use Python"), (r'printf.*\\x', "don't use printf \\x, use Python"), (r'\$\(.*\)', "don't use $(expr), use `expr`"), (r'rm -rf \*', "don't use naked rm -rf, target a directory"), @@ -65,7 +65,7 @@ (r'\$PWD', "don't use $PWD, use `pwd`"), (r'[^\n]\Z', "no trailing newline"), (r'export.*=', "don't export and assign at once"), - (r'^([^"\'\n]|("[^"\n]*")|(\'[^\'\n]*\'))*\\^', "^ must be quoted"), + (r'^([^"\'\n]|("[^"\n]*")|(\'[^\'\n]*\'))*\^', "^ must be quoted"), (r'^source\b', "don't use 'source', use '.'"), (r'touch -d', "don't use 'touch -d', use 'touch -t' instead"), (r'ls +[^|\n-]+ +-', "options to 'ls' must come before filenames"), @@ -73,6 +73,10 @@ (r'^stop\(\)', "don't use 'stop' as a shell function name"), (r'(\[|\btest\b).*-e ', "don't use 'test -e', use 'test -f'"), (r'^alias\b.*=', "don't use alias, use a function"), + (r'if\s*!', "don't use '!' to negate exit status"), + (r'/dev/u?random', "don't use entropy, use /dev/zero"), + (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"), + (r'^( *)\t', "don't use tabs to indent"), ], # warnings [] @@ -84,7 +88,6 @@ ] uprefix = r"^ \$ " -uprefixc = r"^ > " utestpats = [ [ (r'^(\S| $ ).*(\S[ \t]+|^[ \t]+)\n', "trailing whitespace on non-output"), @@ -94,9 +97,7 @@ (uprefix + r'.*\|\| echo.*(fail|error)', "explicit exit code checks unnecessary"), (uprefix + r'set -e', "don't use set -e"), - (uprefixc + r'( *)\t', "don't use tabs to indent"), - (uprefixc + r'.*do\s*true;\s*done', - "don't use true as loop body, use sleep 0"), + (uprefix + r'\s', "don't indent commands, use > for continued lines"), ], # warnings [] @@ -105,9 +106,9 @@ for i in [0, 1]: for p, m in testpats[i]: if p.startswith(r'^'): - p = uprefix + p[1:] + p = r"^ \$ (%s)" % p[1:] else: - p = uprefix + ".*" + p + p = r"^ \$ .*(%s)" % p utestpats[i].append((p, m)) utestfilters = [
--- a/contrib/plan9/proto Tue Apr 24 10:06:17 2012 -0300 +++ b/contrib/plan9/proto Tue Apr 24 20:54:56 2012 -0300 @@ -20,4 +20,5 @@ mercurial-VERSION-py2.5.egg-info - sys sys src - sys sys cmd - sys sys - mercurial - sys sys + hg - sys sys + + - sys sys
--- a/hgext/acl.py Tue Apr 24 10:06:17 2012 -0300 +++ b/hgext/acl.py Tue Apr 24 20:54:56 2012 -0300 @@ -139,9 +139,9 @@ # under the "images" folder: images/** = jack, @designers - # Everyone (except for "user6" - see acl.deny above) will have write - # access to any file under the "resources" folder (except for 1 - # file. See acl.deny): + # Everyone (except for "user6" and "@hg-denied" - see acl.deny above) + # will have write access to any file under the "resources" folder + # (except for 1 file. See acl.deny): src/main/resources/** = * .hgtags = release_engineer
--- a/hgext/notify.py Tue Apr 24 10:06:17 2012 -0300 +++ b/hgext/notify.py Tue Apr 24 20:54:56 2012 -0300 @@ -11,7 +11,7 @@ changesets are being pushed, from the sending or receiving side. First, enable the extension as explained in :hg:`help extensions`, and -register the hook you want to run. ``incoming`` and ``outgoing`` hooks +register the hook you want to run. ``incoming`` and ``changegroup`` hooks are run by the changesets receiver while the ``outgoing`` one is for the sender::
--- a/mercurial/commands.py Tue Apr 24 10:06:17 2012 -0300 +++ b/mercurial/commands.py Tue Apr 24 20:54:56 2012 -0300 @@ -5660,11 +5660,10 @@ rev = cmdutil.finddate(ui, repo, date) if check: - # we could use dirty() but we can ignore merge and branch trivia c = repo[None] - if c.modified() or c.added() or c.removed(): + if c.dirty(merge=False, branch=False): raise util.Abort(_("uncommitted local changes")) - if not rev: + if rev is None: rev = repo[repo[None].branch()].rev() mergemod._checkunknown(repo, repo[None], repo[rev])
--- a/mercurial/context.py Tue Apr 24 10:06:17 2012 -0300 +++ b/mercurial/context.py Tue Apr 24 20:54:56 2012 -0300 @@ -940,14 +940,15 @@ return sorted(self._repo.dirstate.walk(match, self.substate.keys(), True, False)) - def dirty(self, missing=False): + def dirty(self, missing=False, merge=True, branch=True): "check whether a working directory is modified" # check subrepos first for s in self.substate: if self.sub(s).dirty(): return True # check current working dir - return (self.p2() or self.branch() != self.p1().branch() or + return ((merge and self.p2()) or + (branch and self.branch() != self.p1().branch()) or self.modified() or self.added() or self.removed() or (missing and self.deleted()))
--- a/mercurial/encoding.py Tue Apr 24 10:06:17 2012 -0300 +++ b/mercurial/encoding.py Tue Apr 24 20:54:56 2012 -0300 @@ -169,7 +169,7 @@ "best-effort encoding-aware case-folding of local string s" try: return s.encode('ascii').lower() - except UnicodeDecodeError: + except UnicodeError: pass try: if isinstance(s, localstr):
--- a/mercurial/help/glossary.txt Tue Apr 24 10:06:17 2012 -0300 +++ b/mercurial/help/glossary.txt Tue Apr 24 20:54:56 2012 -0300 @@ -135,7 +135,7 @@ See 'Changeset, child'. Close changeset - See 'Changeset, close'. + See 'Head, closed branch' Closed branch See 'Branch, closed'. @@ -237,6 +237,9 @@ closed when all its heads are closed and consequently is not listed by :hg:`branches`. + Closed heads can be re-opened by committing new changeset as the + child of the changeset that marks a head as closed. + Head, repository A topological head which has not been closed.
--- a/mercurial/help/hgignore.txt Tue Apr 24 10:06:17 2012 -0300 +++ b/mercurial/help/hgignore.txt Tue Apr 24 20:54:56 2012 -0300 @@ -63,6 +63,10 @@ and a regexp pattern of the form ``\.c$`` will do the same. To root a regexp pattern, start it with ``^``. +.. note:: + Patterns specified in other than ``.hgignore`` are always rooted. + Please see :hg:`help patterns` for details. + Example -------
--- a/mercurial/help/patterns.txt Tue Apr 24 10:06:17 2012 -0300 +++ b/mercurial/help/patterns.txt Tue Apr 24 20:54:56 2012 -0300 @@ -6,6 +6,10 @@ Alternate pattern notations must be specified explicitly. +.. note:: + Patterns specified in ``.hgignore`` are not rooted. Please see + :hg:`help hgignore` for details. + To use a plain path name without any pattern matching, start it with ``path:``. These path names must completely match starting at the current repository root.
--- a/mercurial/help/subrepos.txt Tue Apr 24 10:06:17 2012 -0300 +++ b/mercurial/help/subrepos.txt Tue Apr 24 20:54:56 2012 -0300 @@ -10,7 +10,8 @@ 1. Nested repository checkouts. They can appear anywhere in the parent working directory. -2. Nested repository references. They are defined in ``.hgsub`` and +2. Nested repository references. They are defined in ``.hgsub``, which + should be placed in the root of working directory, and tell where the subrepository checkouts come from. Mercurial subrepositories are referenced like: @@ -30,7 +31,8 @@ repositories, you have to create and add it to the parent repository before using subrepositories. -3. Nested repository states. They are defined in ``.hgsubstate`` and +3. Nested repository states. They are defined in ``.hgsubstate``, which + is placed in the root of working directory, and capture whatever information is required to restore the subrepositories to the state they were committed in a parent repository changeset. Mercurial automatically record the nested
--- a/mercurial/merge.py Tue Apr 24 10:06:17 2012 -0300 +++ b/mercurial/merge.py Tue Apr 24 20:54:56 2012 -0300 @@ -577,7 +577,8 @@ folding = not util.checkcase(repo.path) if folding: # collision check is not needed for clean update - if not branchmerge and force: + if (not branchmerge and + (force or not wc.dirty(missing=True, branch=False))): _checkcollision(p2, None) else: _checkcollision(p2, wc)
--- a/mercurial/scmutil.py Tue Apr 24 10:06:17 2012 -0300 +++ b/mercurial/scmutil.py Tue Apr 24 20:54:56 2012 -0300 @@ -160,7 +160,7 @@ raise NotImplementedError('attempted instantiating ' + str(type(self))) def tryread(self, path): - 'gracefully return an empty string for missing files' + '''gracefully return an empty string for missing files''' try: return self.read(path) except IOError, inst:
--- a/tests/test-bad-pull.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-bad-pull.t Tue Apr 24 20:54:56 2012 -0300 @@ -20,7 +20,7 @@ $ python dumb.py 2> log & $ P=$! - $ while [ ! -f listening ]; do true; done + $ while [ ! -f listening ]; do sleep 0; done $ hg clone http://localhost:$HGPORT/foo copy2 abort: HTTP Error 404: * (glob) [255]
--- a/tests/test-casecollision-merge.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-casecollision-merge.t Tue Apr 24 20:54:56 2012 -0300 @@ -143,14 +143,14 @@ $ hg commit -m '#2' $ hg update 0 - abort: case-folding collision between a and A - [255] + 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg parents --template '{rev}\n' - 2 + 0 $ hg status -A - C A + C a $ cat A - A + a + $ hg up -qC 2 $ hg update --check 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
--- a/tests/test-check-code-hg.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-check-code-hg.t Tue Apr 24 20:54:56 2012 -0300 @@ -1,6 +1,7 @@ $ check_code="$TESTDIR"/../contrib/check-code.py $ cd "$TESTDIR"/.. - $ if ! hg identify -q > /dev/null; then + $ if hg identify -q > /dev/null; then : + > else > echo "skipped: not a Mercurial working dir" >&2 > exit 80 > fi
--- a/tests/test-commit-amend.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-commit-amend.t Tue Apr 24 20:54:56 2012 -0300 @@ -273,7 +273,7 @@ $ hg mv c d $ hg ci --amend -m 'b -> d' saved backup bundle to $TESTTMP/.hg/strip-backup/9c207120aa98-amend-backup.hg - $ hg st --rev .^ --copies d + $ hg st --rev '.^' --copies d A d b $ hg cp d e @@ -281,7 +281,7 @@ $ hg cp e f $ hg ci --amend -m 'f = d' saved backup bundle to $TESTTMP/.hg/strip-backup/fda2b3b27b22-amend-backup.hg - $ hg st --rev .^ --copies f + $ hg st --rev '.^' --copies f A f d
--- a/tests/test-convert-p4-filetypes Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-convert-p4-filetypes Tue Apr 24 20:54:56 2012 -0300 @@ -44,7 +44,7 @@ T2=`echo $T | tr [:upper:] [:lower:]` case $T in apple) - ;; + ;; symlink*) echo "this is target $T" >target_$T2 ln -s target_$T file_$T2 @@ -52,7 +52,7 @@ p4 add -t $T file_$T2 ;; binary*) - python -c "file('file_$T2', 'wb').write('this is $T')" + python -c "file('file_$T2', 'wb').write('this is $T')" p4 add -t $T file_$T2 ;; *)
--- a/tests/test-convert-splicemap.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-convert-splicemap.t Tue Apr 24 20:54:56 2012 -0300 @@ -125,7 +125,7 @@ the bug should be exhibited with all conversion orders. $ cat > ../splicemap <<EOF - > $(hg id -r 2 -i --debug) $(hg id -r 1 -i --debug), $(hg id -r 3 -i --debug) + > `(hg id -r 2 -i --debug)` `(hg id -r 1 -i --debug)`, `(hg id -r 3 -i --debug)` > EOF $ cd .. $ cat splicemap @@ -169,9 +169,9 @@ converting... 0 addb $ cat > splicemap <<EOF - > $(hg -R ordered id -r 2 -i --debug) \ - > $(hg -R ordered-hg2 id -r 1 -i --debug),\ - > $(hg -R ordered-hg2 id -r 2 -i --debug) + > `(hg -R ordered id -r 2 -i --debug)` \ + > `(hg -R ordered-hg2 id -r 1 -i --debug)`,\ + > `(hg -R ordered-hg2 id -r 2 -i --debug)` > deadbeef102a90ea7b4a3361e4082ed620918c26 deadbeef102a90ea7b4a3361e4082ed620918c27 > EOF $ hg convert --splicemap splicemap ordered ordered-hg2 @@ -211,9 +211,9 @@ Test invalid dependency $ cat > splicemap <<EOF - > $(hg -R ordered id -r 2 -i --debug) \ + > `(hg -R ordered id -r 2 -i --debug)` \ > deadbeef102a90ea7b4a3361e4082ed620918c26,\ - > $(hg -R ordered-hg2 id -r 2 -i --debug) + > `(hg -R ordered-hg2 id -r 2 -i --debug)` > EOF $ hg convert --splicemap splicemap ordered ordered-hg4 initializing destination ordered-hg4 repository
--- a/tests/test-copy2.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-copy2.t Tue Apr 24 20:54:56 2012 -0300 @@ -100,7 +100,7 @@ bar foo was clean: - $ hg st -AC foo + $ hg st -AC foo C foo but it's considered modified after a copy --after --force $ hg copy -Af bar foo
--- a/tests/test-diff-change.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-diff-change.t Tue Apr 24 20:54:56 2012 -0300 @@ -33,8 +33,8 @@ Testing diff --change when merge: $ for i in 1 2 3 4 5 6 7 8 9 10; do - $ echo $i >> file.txt - $ done + > echo $i >> file.txt + > done $ hg commit -m "lots of text" # 3 $ sed -e 's,^2$,x,' file.txt > file.txt.tmp
--- a/tests/test-filelog Tue Apr 24 10:06:17 2012 -0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -#!/usr/bin/env python -""" -Tests the behaviour of filelog w.r.t. data starting with '\1\n' -""" -from mercurial import ui, hg -from mercurial.node import nullid, hex - -myui = ui.ui() -repo = hg.repository(myui, path='.', create=True) - -fl = repo.file('foobar') - -def addrev(text, renamed=False): - if renamed: - # data doesnt matter. Just make sure filelog.renamed() returns True - meta = dict(copyrev=hex(nullid), copy='bar') - else: - meta = {} - - lock = t = None - try: - lock = repo.lock() - t = repo.transaction('commit') - node = fl.add(text, meta, t, 0, nullid, nullid) - return node - finally: - if t: - t.close() - if lock: - lock.release() - -def error(text): - print 'ERROR: ' + text - -textwith = '\1\nfoo' -without = 'foo' - -node = addrev(textwith) -if not textwith == fl.read(node): - error('filelog.read for data starting with \\1\\n') -if fl.cmp(node, textwith) or not fl.cmp(node, without): - error('filelog.cmp for data starting with \\1\\n') -if fl.size(0) != len(textwith): - error('FIXME: This is a known failure of filelog.size for data starting ' - 'with \\1\\n') - -node = addrev(textwith, renamed=True) -if not textwith == fl.read(node): - error('filelog.read for a renaming + data starting with \\1\\n') -if fl.cmp(node, textwith) or not fl.cmp(node, without): - error('filelog.cmp for a renaming + data starting with \\1\\n') -if fl.size(1) != len(textwith): - error('filelog.size for a renaming + data starting with \\1\\n') - -print 'OK.'
--- a/tests/test-filelog.out Tue Apr 24 10:06:17 2012 -0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -ERROR: FIXME: This is a known failure of filelog.size for data starting with \1\n -OK.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-filelog.py Tue Apr 24 20:54:56 2012 -0300 @@ -0,0 +1,55 @@ +#!/usr/bin/env python +""" +Tests the behaviour of filelog w.r.t. data starting with '\1\n' +""" +from mercurial import ui, hg +from mercurial.node import nullid, hex + +myui = ui.ui() +repo = hg.repository(myui, path='.', create=True) + +fl = repo.file('foobar') + +def addrev(text, renamed=False): + if renamed: + # data doesnt matter. Just make sure filelog.renamed() returns True + meta = dict(copyrev=hex(nullid), copy='bar') + else: + meta = {} + + lock = t = None + try: + lock = repo.lock() + t = repo.transaction('commit') + node = fl.add(text, meta, t, 0, nullid, nullid) + return node + finally: + if t: + t.close() + if lock: + lock.release() + +def error(text): + print 'ERROR: ' + text + +textwith = '\1\nfoo' +without = 'foo' + +node = addrev(textwith) +if not textwith == fl.read(node): + error('filelog.read for data starting with \\1\\n') +if fl.cmp(node, textwith) or not fl.cmp(node, without): + error('filelog.cmp for data starting with \\1\\n') +if fl.size(0) != len(textwith): + error('FIXME: This is a known failure of filelog.size for data starting ' + 'with \\1\\n') + +node = addrev(textwith, renamed=True) +if not textwith == fl.read(node): + error('filelog.read for a renaming + data starting with \\1\\n') +if fl.cmp(node, textwith) or not fl.cmp(node, without): + error('filelog.cmp for a renaming + data starting with \\1\\n') +if fl.size(1) != len(textwith): + error('filelog.size for a renaming + data starting with \\1\\n') + +print 'OK.'
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-filelog.py.out Tue Apr 24 20:54:56 2012 -0300 @@ -0,0 +1,2 @@ +ERROR: FIXME: This is a known failure of filelog.size for data starting with \1\n +OK.
--- a/tests/test-glog.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-glog.t Tue Apr 24 20:54:56 2012 -0300 @@ -1428,7 +1428,7 @@ > | sed 's/.*nodetag/nodetag/' > log.nodes > hg log -G --template 'nodetag {rev}\n' "$@" | grep nodetag \ > | sed 's/.*nodetag/nodetag/' > glog.nodes - > diff -u log.nodes glog.nodes + > diff -u log.nodes glog.nodes | grep '^[-+@ ]' || : > } glog always reorders nodes which explains the difference with log @@ -1448,7 +1448,6 @@ +nodetag 27 +nodetag 25 +nodetag 21 - [1] $ testlog -u test -u not-a-user [] (group @@ -1975,7 +1974,6 @@ nodetag 8 nodetag 7 +nodetag 6 - [1] Test --follow-first and forward --rev @@ -1992,7 +1990,6 @@ nodetag 8 nodetag 7 +nodetag 6 - [1] Test --follow and backward --rev
--- a/tests/test-hgignore.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-hgignore.t Tue Apr 24 20:54:56 2012 -0300 @@ -48,7 +48,7 @@ [255] $ echo ".*\.o" > .hgignore - $ hg status + $ hg status A dir/b.o ? .hgignore ? a.c
--- a/tests/test-hgweb-raw.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-hgweb-raw.t Tue Apr 24 20:54:56 2012 -0300 @@ -20,7 +20,7 @@ $ cat hg.pid >> $DAEMON_PIDS $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt - $ while kill `cat hg.pid` 2>/dev/null; do true; done + $ while kill `cat hg.pid` 2>/dev/null; do sleep 0; done $ cat getoutput.txt 200 Script output follows @@ -41,7 +41,7 @@ $ cat hg.pid >> $DAEMON_PIDS $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt - $ while kill `cat hg.pid` 2>/dev/null; do true; done + $ while kill `cat hg.pid` 2>/dev/null; do sleep 0; done $ cat getoutput.txt 200 Script output follows
--- a/tests/test-http-proxy.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-http-proxy.t Tue Apr 24 20:54:56 2012 -0300 @@ -9,7 +9,7 @@ $ cat hg.pid >> $DAEMON_PIDS $ cd .. $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null & - $ while [ ! -f proxy.pid ]; do true; done + $ while [ ! -f proxy.pid ]; do sleep 0; done $ cat proxy.pid >> $DAEMON_PIDS url for proxy, stream
--- a/tests/test-https.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-https.t Tue Apr 24 20:54:56 2012 -0300 @@ -233,12 +233,12 @@ $ hg -R copy-pull id https://127.0.0.1:$HGPORT/ 5fed3813f7f5 - $ while kill `cat hg1.pid` 2>/dev/null; do true; done + $ while kill `cat hg1.pid` 2>/dev/null; do sleep 0; done Prepare for connecting through proxy $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log </dev/null 2>&1 & - $ while [ ! -f proxy.pid ]; do true; done + $ while [ ! -f proxy.pid ]; do sleep 0; done $ cat proxy.pid >> $DAEMON_PIDS $ echo "[http_proxy]" >> copy-pull/.hg/hgrc
--- a/tests/test-largefiles.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-largefiles.t Tue Apr 24 20:54:56 2012 -0300 @@ -815,7 +815,7 @@ Test --normal flag - $ dd if=/dev/urandom bs=2k count=11k > new-largefile 2> /dev/null + $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null $ hg add --normal --large new-largefile abort: --normal cannot be used with --large [255] @@ -945,7 +945,7 @@ $ cd alice $ hg init pubrepo $ cd pubrepo - $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null + $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null $ hg add --large a-large-file $ hg commit -m "Add a large file" Invoking status precommit hook
--- a/tests/test-notify.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-notify.t Tue Apr 24 20:54:56 2012 -0300 @@ -23,7 +23,7 @@ are being pushed, from the sending or receiving side. First, enable the extension as explained in "hg help extensions", and register - the hook you want to run. "incoming" and "outgoing" hooks are run by the + the hook you want to run. "incoming" and "changegroup" hooks are run by the changesets receiver while the "outgoing" one is for the sender: [hooks]
--- a/tests/test-pull-pull-corruption.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-pull-pull-corruption.t Tue Apr 24 20:54:56 2012 -0300 @@ -37,26 +37,27 @@ start a pull... - $ hg pull ../source1 & + $ hg pull ../source1 > pull.out 2>&1 & ... and start another pull before the first one has finished $ sleep 1 - pulling from ../source1 - requesting all changes $ hg pull ../source2 2>/dev/null pulling from ../source2 - adding changesets - adding manifests - adding file changes - added 10 changesets with 10 changes to 1 files - (run 'hg update' to get a working copy) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) (run 'hg heads' to see heads, 'hg merge' to merge) + $ cat pull.out + pulling from ../source1 + requesting all changes + adding changesets + adding manifests + adding file changes + added 10 changesets with 10 changes to 1 files + (run 'hg update' to get a working copy) see the result
--- a/tests/test-pull-pull-corruption2.t Tue Apr 24 10:06:17 2012 -0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -Corrupt an hg repo with two pulls. -create one repo with a long history - - $ hg init source1 - $ cd source1 - $ touch foo - $ hg add foo - $ for i in 1 2 3 4 5 6 7 8 9 10; do - > echo $i >> foo - > hg ci -m $i - > done - $ cd .. - -create a third repo to pull both other repos into it - - $ hg init version2 - $ hg -R version2 pull source1 & - $ sleep 1 - pulling from source1 - requesting all changes - adding changesets - adding manifests - adding file changes - added 10 changesets with 10 changes to 1 files - (run 'hg update' to get a working copy) - $ hg clone --pull -U version2 corrupted - requesting all changes - adding changesets - adding manifests - adding file changes - added 10 changesets with 10 changes to 1 files - $ wait - $ hg -R corrupted verify - checking changesets - checking manifests - crosschecking files in changesets and manifests - checking files - 1 files, 10 changesets, 10 total revisions - $ hg -R version2 verify - checking changesets - checking manifests - crosschecking files in changesets and manifests - checking files - 1 files, 10 changesets, 10 total revisions
--- a/tests/test-serve.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-serve.t Tue Apr 24 20:54:56 2012 -0300 @@ -28,9 +28,9 @@ $ hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> "$DAEMON_PIDS" $ if [ -f access.log ]; then - $ echo 'access log created - .hg/hgrc respected' + > echo 'access log created - .hg/hgrc respected' + > fi access log created - .hg/hgrc respected - $ fi errors
--- a/tests/test-update-branches.t Tue Apr 24 10:06:17 2012 -0300 +++ b/tests/test-update-branches.t Tue Apr 24 20:54:56 2012 -0300 @@ -15,6 +15,11 @@ $ hg init $ echo foo > foo $ echo zero > a + $ hg init sub + $ echo suba > sub/suba + $ hg --cwd sub ci -Am addsuba + adding suba + $ echo 'sub = sub' > .hgsub $ hg ci -qAm0 $ echo one > a ; hg ci -m1 $ echo two > a ; hg ci -m2 @@ -29,44 +34,46 @@ $ hg --config 'extensions.graphlog=' \ > glog --template '{rev}:{node|short} {parents} {branches}\n' - @ 5:e1bb631146ca b1 + @ 5:ff252e8273df b1 | - o 4:a4fdb3b883c4 0:b608b9236435 b1 + o 4:d047485b3896 0:60829823a42a b1 | - | o 3:4b57d2520816 1:44592833ba9f + | o 3:6efa171f091b 1:0786582aa4b1 | | - | | o 2:063f31070f65 + | | o 2:bd10386d478c | |/ - | o 1:44592833ba9f + | o 1:0786582aa4b1 |/ - o 0:b608b9236435 + o 0:60829823a42a Test helper functions: $ revtest () { > msg=$1 - > dirtyflag=$2 # 'clean' or 'dirty' + > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub' > startrev=$3 > targetrev=$4 > opt=$5 > hg up -qC $startrev > test $dirtyflag = dirty && echo dirty > foo + > test $dirtyflag = dirtysub && echo dirty > sub/suba > hg up $opt $targetrev > hg parent --template 'parent={rev}\n' - > hg stat + > hg stat -S > } $ norevtest () { > msg=$1 - > dirtyflag=$2 # 'clean' or 'dirty' + > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub' > startrev=$3 > opt=$4 > hg up -qC $startrev > test $dirtyflag = dirty && echo dirty > foo + > test $dirtyflag = dirtysub && echo dirty > sub/suba > hg up $opt > hg parent --template 'parent={rev}\n' - > hg stat + > hg stat -S > } Test cases are documented in a table in the update function of merge.py. @@ -99,16 +106,30 @@ parent=2 M foo + $ revtest 'none dirtysub linear' dirtysub 1 2 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + parent=2 + M sub/suba + $ revtest 'none dirty same' dirty 2 3 abort: crosses branches (merge branches or use --clean to discard changes) parent=2 M foo + $ revtest 'none dirtysub same' dirtysub 2 3 + abort: crosses branches (merge branches or use --clean to discard changes) + parent=2 + M sub/suba + $ revtest 'none dirty cross' dirty 3 4 abort: crosses branches (merge branches or use --clean to discard changes) parent=3 M foo + $ revtest 'none dirtysub cross' dirtysub 3 4 + abort: crosses branches (merge branches or use --clean to discard changes) + parent=3 + M sub/suba $ revtest '-C dirty linear' dirty 1 2 -C 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -119,6 +140,11 @@ parent=1 M foo + $ revtest '-c dirtysub linear' dirtysub 1 2 -c + abort: uncommitted local changes + parent=1 + M sub/suba + $ norevtest '-c clean same' clean 2 -c 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=3