Mercurial > hg-stable
changeset 16674:76c744e0c5bb
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 12 May 2012 13:20:26 +0200 |
parents | e410be860393 (current diff) 775a8d33e6f0 (diff) |
children | f29f187ee73d |
files | tests/test-check-code-hg.t tests/test-convert-baz tests/test-convert-baz.out tests/test-convert-p4 tests/test-convert-p4-filetypes tests/test-convert-p4-filetypes.out tests/test-convert-p4.out |
diffstat | 14 files changed, 1087 insertions(+), 1103 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Sat May 12 10:55:08 2012 +0200 +++ b/contrib/check-code.py Sat May 12 13:20:26 2012 +0200 @@ -45,12 +45,10 @@ [ (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"), (r'sed.*-i', "don't use 'sed -i', use a temporary file"), (r'echo.*\\n', "don't use 'echo \\n', use printf"), (r'echo -n', "don't use 'echo -n', use printf"), - (r'^diff.*-\w*N', "don't use 'diff -N'"), (r'(^| )wc[^|]*$\n(?!.*\(re\))', "filter wc output"), (r'head -c', "don't use 'head -c', use 'dd'"), (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"), @@ -62,10 +60,8 @@ (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w', "use egrep for extended grep syntax"), (r'/bin/', "don't use explicit paths for tools"), - (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'^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"), @@ -79,7 +75,12 @@ (r'^( *)\t', "don't use tabs to indent"), ], # warnings - [] + [ + (r'^function', "don't use 'function', use old style"), + (r'^diff.*-\w*N', "don't use 'diff -N'"), + (r'\$PWD', "don't use $PWD, use `pwd`"), + (r'^([^"\'\n]|("[^"\n]*")|(\'[^\'\n]*\'))*\^', "^ must be quoted"), + ] ] testfilters = [ @@ -91,7 +92,8 @@ utestpats = [ [ (r'^(\S| $ ).*(\S[ \t]+|^[ \t]+)\n', "trailing whitespace on non-output"), - (uprefix + r'.*\|\s*sed', "use regex test output patterns instead of sed"), + (uprefix + r'.*\|\s*sed[^|>\n]*\n', + "use regex test output patterns instead of sed"), (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), (uprefix + r'.*(?<!\[)\$\?', "explicit exit code checks unnecessary"), (uprefix + r'.*\|\| echo.*(fail|error)', @@ -106,9 +108,9 @@ for i in [0, 1]: for p, m in testpats[i]: if p.startswith(r'^'): - p = r"^ \$ (%s)" % p[1:] + p = r"^ [$>] (%s)" % p[1:] else: - p = r"^ \$ .*(%s)" % p + p = r"^ [$>] .*(%s)" % p utestpats[i].append((p, m)) utestfilters = [
--- a/hgext/children.py Sat May 12 10:55:08 2012 +0200 +++ b/hgext/children.py Sat May 12 13:20:26 2012 +0200 @@ -8,7 +8,11 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -'''command to display child changesets''' +'''command to display child changesets (DEPRECATED) + +This extension is deprecated. You should use :hg:`log -r +"children(REV)"` instead. +''' from mercurial import cmdutil from mercurial.commands import templateopts
--- a/hgext/fetch.py Sat May 12 10:55:08 2012 +0200 +++ b/hgext/fetch.py Sat May 12 13:20:26 2012 +0200 @@ -5,7 +5,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -'''pull, update and merge in one command''' +'''pull, update and merge in one command (DEPRECATED)''' from mercurial.i18n import _ from mercurial.node import nullid, short
--- a/mercurial/extensions.py Sat May 12 10:55:08 2012 +0200 +++ b/mercurial/extensions.py Sat May 12 13:20:26 2012 +0200 @@ -301,7 +301,7 @@ def disabledcmd(ui, cmd, strict=False): '''import disabled extensions until cmd is found. - returns (cmdname, extname, doc)''' + returns (cmdname, extname, module)''' paths = _disabledpaths(strip_init=True) if not paths: @@ -329,18 +329,19 @@ cmd = aliases[0] return (cmd, name, mod) + ext = None # first, search for an extension with the same name as the command path = paths.pop(cmd, None) if path: ext = findcmd(cmd, cmd, path) - if ext: - return ext - - # otherwise, interrogate each extension until there's a match - for name, path in paths.iteritems(): - ext = findcmd(cmd, name, path) - if ext: - return ext + if not ext: + # otherwise, interrogate each extension until there's a match + for name, path in paths.iteritems(): + ext = findcmd(cmd, name, path) + if ext: + break + if ext and 'DEPRECATED' not in ext.__doc__: + return ext raise error.UnknownCommand(cmd)
--- a/tests/test-check-code-hg.t Sat May 12 10:55:08 2012 +0200 +++ b/tests/test-check-code-hg.t Sat May 12 13:20:26 2012 +0200 @@ -610,12 +610,25 @@ tests/test-commandserver.py:0: > print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***', data)) warning: line over 80 characters + tests/test-convert-mtn.t:0: + > > function get_passphrase(keypair_id) + don't use 'function', use old style tests/test-filecache.py:0: > except: warning: naked except clause tests/test-filecache.py:0: > if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'], 'cacheable']): warning: line over 80 characters + tests/test-import-git.t:0: + > > Mc\${NkU|\`?^000jF3jhEB + ^ must be quoted + tests/test-import.t:0: + > > diff -Naur proj-orig/foo proj-new/foo + don't use 'diff -N' + don't use 'diff -N' + tests/test-schemes.t:0: + > > z = file:\$PWD/ + don't use $PWD, use `pwd` tests/test-ui-color.py:0: > testui.warn('warning\n') warning: unwrapped ui message
--- a/tests/test-convert-baz Sat May 12 10:55:08 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -#!/bin/sh - -"$TESTDIR/hghave" baz || exit 80 - -baz my-id "mercurial <mercurial@selenic.com>" - -echo "[extensions]" >> $HGRCPATH -echo "convert=" >> $HGRCPATH -echo 'graphlog =' >> $HGRCPATH - -echo % create baz archive -baz make-archive baz@mercurial--convert hg-test-convert-baz - -echo % initialize baz repo -mkdir baz-repo -cd baz-repo/ -baz init-tree baz@mercurial--convert/baz--test--0 -baz import - -echo % create initial files -echo 'this is a file' > a -baz add a -mkdir src -baz add src -cd src -dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null -baz add b -# HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead" -baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v '^tar' - -echo % create link file and modify a -ln -s ../a a-link -baz add a-link -echo 'this a modification to a' >> ../a -baz commit -s "added link to a and modify a" - -echo % create second link and modify b -ln -s ../a a-link-2 -baz add a-link-2 -dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null -baz commit -s "added second link and modify b" - -echo % b file to link and a-link-2 to regular file -rm -f a-link-2 -echo 'this is now a regular file' > a-link-2 -ln -sf ../a b -baz commit -s "file to link and link to file test" - -echo % move a-link-2 file and src directory -cd .. -baz mv src/a-link-2 c -baz mv src test -baz commit -s "move and rename a-link-2 file and src directory" - -echo % move and add the moved file again -echo e > e -baz add e -baz commit -s "add e" -baz mv e f -echo ee > e -baz add e -baz commit -s "move e and recreate it again" -cd .. - -echo % converting baz repo to Mercurial -hg convert baz-repo baz-repo-hg - -baz register-archive -d baz@mercurial--convert - -glog() -{ - hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" -} - -echo % show graph log -glog -R baz-repo-hg -hg up -q -R baz-repo-hg -hg -R baz-repo-hg manifest --debug -hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies
--- a/tests/test-convert-baz.out Sat May 12 10:55:08 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -% create baz archive -% initialize baz repo -* creating version baz@mercurial--convert/baz--test--0 -* imported baz@mercurial--convert/baz--test--0 -% create initial files -* build pristine tree for baz@mercurial--convert/baz--test--0--base-0 -* Scanning for full-tree revision: . -* from import revision: baz@mercurial--convert/baz--test--0--base-0 -A/ .arch-ids -A/ src -A/ src/.arch-ids -A .arch-ids/a.id -A a -A src/.arch-ids/=id -A src/.arch-ids/b.id -A src/b -* update pristine tree (baz@mercurial--convert/baz--test--0--base-0 => baz--test--0--patch-1) -* committed baz@mercurial--convert/baz--test--0--patch-1 -% create link file and modify a -A src/.arch-ids/a-link.id -A src/a-link -M a -* update pristine tree (baz@mercurial--convert/baz--test--0--patch-1 => baz--test--0--patch-2) -* committed baz@mercurial--convert/baz--test--0--patch-2 -% create second link and modify b -A src/.arch-ids/a-link-2.id -A src/a-link-2 -Mb src/b -* update pristine tree (baz@mercurial--convert/baz--test--0--patch-2 => baz--test--0--patch-3) -* committed baz@mercurial--convert/baz--test--0--patch-3 -% b file to link and a-link-2 to regular file -fl src/b -lf src/a-link-2 -* update pristine tree (baz@mercurial--convert/baz--test--0--patch-3 => baz--test--0--patch-4) -* committed baz@mercurial--convert/baz--test--0--patch-4 -% move a-link-2 file and src directory -D/ src/.arch-ids -A/ test/.arch-ids -/> src test -=> src/.arch-ids/a-link-2.id .arch-ids/c.id -=> src/a-link-2 c -=> src/.arch-ids/=id test/.arch-ids/=id -=> src/.arch-ids/a-link.id test/.arch-ids/a-link.id -=> src/.arch-ids/b.id test/.arch-ids/b.id -* update pristine tree (baz@mercurial--convert/baz--test--0--patch-4 => baz--test--0--patch-5) -* committed baz@mercurial--convert/baz--test--0--patch-5 -% move and add the moved file again -A .arch-ids/e.id -A e -* update pristine tree (baz@mercurial--convert/baz--test--0--patch-5 => baz--test--0--patch-6) -* committed baz@mercurial--convert/baz--test--0--patch-6 -A .arch-ids/e.id -A e -=> .arch-ids/e.id .arch-ids/f.id -=> e f -* update pristine tree (baz@mercurial--convert/baz--test--0--patch-6 => baz--test--0--patch-7) -* committed baz@mercurial--convert/baz--test--0--patch-7 -% converting baz repo to Mercurial -initializing destination baz-repo-hg repository -analyzing tree version baz@mercurial--convert/baz--test--0... -scanning source... -sorting... -converting... -7 initial import -6 added a file, src and src/b (binary) -5 added link to a and modify a -4 added second link and modify b -3 file to link and link to file test -2 move and rename a-link-2 file and src directory -1 add e -0 move e and recreate it again -% show graph log -o 7 "move e and recreate it again" files: e f -| -o 6 "add e" files: e -| -o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b -| -o 4 "file to link and link to file test" files: src/a-link-2 src/b -| -o 3 "added second link and modify b" files: src/a-link-2 src/b -| -o 2 "added link to a and modify a" files: a src/a-link -| -o 1 "added a file, src and src/b (binary)" files: a src/b -| -o 0 "initial import" files: - -c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a -0201ac32a3a8e86e303dff60366382a54b48a72e 644 c -1a4a864db0073705a11b1439f563bfa4b46d9246 644 e -09e0222742fc3f75777fa9d68a5d8af7294cb5e7 644 f -c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link -375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b -copies: c (src/a-link-2) test/a-link (src/a-link) test/b (src/b) -copies: f (e)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-convert-baz.t Sat May 12 13:20:26 2012 +0200 @@ -0,0 +1,163 @@ + $ "$TESTDIR/hghave" baz || exit 80 + + $ baz my-id "mercurial <mercurial@selenic.com>" + + $ echo "[extensions]" >> $HGRCPATH + $ echo "convert=" >> $HGRCPATH + $ echo 'graphlog =' >> $HGRCPATH + +create baz archive + $ baz make-archive baz@mercurial--convert hg-test-convert-baz + +initialize baz repo + $ mkdir baz-repo + $ cd baz-repo/ + $ baz init-tree baz@mercurial--convert/baz--test--0 + $ baz import + * creating version baz@mercurial--convert/baz--test--0 + * imported baz@mercurial--convert/baz--test--0 + +create initial files + $ echo 'this is a file' > a + $ baz add a + $ mkdir src + $ baz add src + $ cd src + $ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null + $ baz add b +HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead" + $ baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v '^tar' + * build pristine tree for baz@mercurial--convert/baz--test--0--base-0 + * Scanning for full-tree revision: . + * from import revision: baz@mercurial--convert/baz--test--0--base-0 + A/ .arch-ids + A/ src + A/ src/.arch-ids + A .arch-ids/a.id + A a + A src/.arch-ids/=id + A src/.arch-ids/b.id + A src/b + * update pristine tree (baz@mercurial--convert/baz--test--0--base-0 => baz--test--0--patch-1) + * committed baz@mercurial--convert/baz--test--0--patch-1 + +create link file and modify a + $ ln -s ../a a-link + $ baz add a-link + $ echo 'this a modification to a' >> ../a + $ baz commit -s "added link to a and modify a" + A src/.arch-ids/a-link.id + A src/a-link + M a + * update pristine tree (baz@mercurial--convert/baz--test--0--patch-1 => baz--test--0--patch-2) + * committed baz@mercurial--convert/baz--test--0--patch-2 + +create second link and modify b + $ ln -s ../a a-link-2 + $ baz add a-link-2 + $ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null + $ baz commit -s "added second link and modify b" + A src/.arch-ids/a-link-2.id + A src/a-link-2 + Mb src/b + * update pristine tree (baz@mercurial--convert/baz--test--0--patch-2 => baz--test--0--patch-3) + * committed baz@mercurial--convert/baz--test--0--patch-3 + +b file to link and a-link-2 to regular file + $ rm -f a-link-2 + $ echo 'this is now a regular file' > a-link-2 + $ ln -sf ../a b + $ baz commit -s "file to link and link to file test" + fl src/b + lf src/a-link-2 + * update pristine tree (baz@mercurial--convert/baz--test--0--patch-3 => baz--test--0--patch-4) + * committed baz@mercurial--convert/baz--test--0--patch-4 + +move a-link-2 file and src directory + $ cd .. + $ baz mv src/a-link-2 c + $ baz mv src test + $ baz commit -s "move and rename a-link-2 file and src directory" + D/ src/.arch-ids + A/ test/.arch-ids + /> src test + => src/.arch-ids/a-link-2.id .arch-ids/c.id + => src/a-link-2 c + => src/.arch-ids/=id test/.arch-ids/=id + => src/.arch-ids/a-link.id test/.arch-ids/a-link.id + => src/.arch-ids/b.id test/.arch-ids/b.id + * update pristine tree (baz@mercurial--convert/baz--test--0--patch-4 => baz--test--0--patch-5) + * committed baz@mercurial--convert/baz--test--0--patch-5 + +move and add the moved file again + $ echo e > e + $ baz add e + $ baz commit -s "add e" + A .arch-ids/e.id + A e + * update pristine tree (baz@mercurial--convert/baz--test--0--patch-5 => baz--test--0--patch-6) + * committed baz@mercurial--convert/baz--test--0--patch-6 + $ baz mv e f + $ echo ee > e + $ baz add e + $ baz commit -s "move e and recreate it again" + A .arch-ids/e.id + A e + => .arch-ids/e.id .arch-ids/f.id + => e f + * update pristine tree (baz@mercurial--convert/baz--test--0--patch-6 => baz--test--0--patch-7) + * committed baz@mercurial--convert/baz--test--0--patch-7 + $ cd .. + +converting baz repo to Mercurial + $ hg convert baz-repo baz-repo-hg + initializing destination baz-repo-hg repository + analyzing tree version baz@mercurial--convert/baz--test--0... + scanning source... + sorting... + converting... + 7 initial import + 6 added a file, src and src/b (binary) + 5 added link to a and modify a + 4 added second link and modify b + 3 file to link and link to file test + 2 move and rename a-link-2 file and src directory + 1 add e + 0 move e and recreate it again + + $ baz register-archive -d baz@mercurial--convert + + $ glog() + > { + > hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" + > } + +show graph log + $ glog -R baz-repo-hg + o 7 "move e and recreate it again" files: e f + | + o 6 "add e" files: e + | + o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b + | + o 4 "file to link and link to file test" files: src/a-link-2 src/b + | + o 3 "added second link and modify b" files: src/a-link-2 src/b + | + o 2 "added link to a and modify a" files: a src/a-link + | + o 1 "added a file, src and src/b (binary)" files: a src/b + | + o 0 "initial import" files: + + $ hg up -q -R baz-repo-hg + $ hg -R baz-repo-hg manifest --debug + c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a + 0201ac32a3a8e86e303dff60366382a54b48a72e 644 c + 1a4a864db0073705a11b1439f563bfa4b46d9246 644 e + 09e0222742fc3f75777fa9d68a5d8af7294cb5e7 644 f + c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link + 375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b + $ hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies + copies: c (src/a-link-2) test/a-link (src/a-link) test/b (src/b) + copies: f (e)
--- a/tests/test-convert-p4 Sat May 12 10:55:08 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -#!/bin/sh - -"$TESTDIR/hghave" p4 || exit 80 - -echo "[extensions]" >> $HGRCPATH -echo "convert = " >> $HGRCPATH - -echo % create p4 depot -P4ROOT=`pwd`/depot; export P4ROOT -P4AUDIT=$P4ROOT/audit; export P4AUDIT -P4JOURNAL=$P4ROOT/journal; export P4JOURNAL -P4LOG=$P4ROOT/log; export P4LOG -P4PORT=localhost:16661; export P4PORT -P4DEBUG=1; export P4DEBUG - -echo % start the p4 server -[ ! -d $P4ROOT ] && mkdir $P4ROOT -p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & -trap "echo % stop the p4 server ; p4 admin stop" EXIT - -# wait for the server to initialize -while ! p4 ; do - sleep 1 -done >/dev/null 2>/dev/null - -echo % create a client spec -P4CLIENT=hg-p4-import; export P4CLIENT -DEPOTPATH=//depot/test-mercurial-import/... -p4 client -o | sed '/^View:/,$ d' >p4client -echo View: >>p4client -echo " $DEPOTPATH //$P4CLIENT/..." >>p4client -p4 client -i <p4client - -echo % populate the depot -echo a > a -mkdir b -echo c > b/c -p4 add a b/c -p4 submit -d initial - -echo % change some files -p4 edit a -echo aa >> a -p4 submit -d "change a" - -p4 edit b/c -echo cc >> b/c -p4 submit -d "change b/c" - -echo % convert -hg convert -s p4 $DEPOTPATH dst -hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' - -echo % change some files -p4 edit a b/c -echo aaa >> a -echo ccc >> b/c -p4 submit -d "change a b/c" - -echo % convert again -hg convert -s p4 $DEPOTPATH dst -hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' - -echo % interesting names -echo dddd > "d d" -mkdir " e" -echo fff >" e/ f" -p4 add "d d" " e/ f" -p4 submit -d "add d e f" - -echo % convert again -hg convert -s p4 $DEPOTPATH dst -hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' - -
--- a/tests/test-convert-p4-filetypes Sat May 12 10:55:08 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -#!/bin/sh - -"$TESTDIR/hghave" p4 execbit symlink || exit 80 - -echo "[extensions]" >> $HGRCPATH -echo "convert = " >> $HGRCPATH - -echo % create p4 depot -P4ROOT=`pwd`/depot; export P4ROOT -P4AUDIT=$P4ROOT/audit; export P4AUDIT -P4JOURNAL=$P4ROOT/journal; export P4JOURNAL -P4LOG=$P4ROOT/log; export P4LOG -P4PORT=localhost:16661; export P4PORT -P4DEBUG=1; export P4DEBUG -P4CHARSET=utf8; export P4CHARSET - -echo % start the p4 server -[ ! -d $P4ROOT ] && mkdir $P4ROOT -p4d -f -J off -xi >$P4ROOT/stdout 2>$P4ROOT/stderr -p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & -trap "echo % stop the p4 server ; p4 admin stop" EXIT - -# wait for the server to initialize -while ! p4 ; do - sleep 1 -done >/dev/null 2>/dev/null - -echo % create a client spec -P4CLIENT=hg-p4-import; export P4CLIENT -DEPOTPATH=//depot/test-mercurial-import/... -p4 client -o | sed '/^View:/,$ d' >p4client -echo View: >>p4client -echo " $DEPOTPATH //$P4CLIENT/..." >>p4client -p4 client -i <p4client - -echo % populate the depot -TYPES="text binary symlink" -TYPES="$TYPES text+m text+w text+x text+k text+kx text+ko text+l text+C text+D text+F text+S text+S2" -TYPES="$TYPES binary+k binary+x binary+kx symlink+k" -TYPES="$TYPES ctext cxtext ktext kxtext ltext tempobj ubinary uxbinary xbinary xltext xtempobj xtext" -# not testing these -#TYPES="$TYPES apple resource unicode utf16 uresource xunicode xutf16" -for T in $TYPES ; do - T2=`echo $T | tr [:upper:] [:lower:]` - case $T in - apple) - ;; - symlink*) - echo "this is target $T" >target_$T2 - ln -s target_$T file_$T2 - p4 add target_$T2 - p4 add -t $T file_$T2 - ;; - binary*) - python -c "file('file_$T2', 'wb').write('this is $T')" - p4 add -t $T file_$T2 - ;; - *) - echo "this is $T" >file_$T2 - p4 add -t $T file_$T2 - ;; - esac -done -p4 submit -d initial - -echo % test keyword expansion -p4 edit file_* target_* -for T in $TYPES ; do - T2=`echo $T | tr [:upper:] [:lower:]` - echo '$Id$' >>file_$T2 - echo '$Header$' >>file_$T2 - echo '$Date$' >>file_$T2 - echo '$DateTime$' >>file_$T2 - echo '$Change$' >>file_$T2 - echo '$File$' >>file_$T2 - echo '$Revision$' >>file_$T2 - echo '$Header$$Header$Header$' >>file_$T2 -done - -ln -s 'target_$Header$' crazy_symlink+k -p4 add -t symlink+k crazy_symlink+k - -p4 submit -d keywords - -echo % check keywords in p4 -grep -H Header file_* - -echo % convert -hg convert -s p4 $DEPOTPATH dst -hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'g - -echo % revision 0 -hg -R dst update 0 -head dst/file_* | cat -v - -echo -echo % revision 1 -hg -R dst update 1 -head dst/file_* | cat -v -echo -echo % crazy_symlink -readlink crazy_symlink+k -readlink dst/crazy_symlink+k -
--- a/tests/test-convert-p4-filetypes.out Sat May 12 10:55:08 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,642 +0,0 @@ -% create p4 depot -% start the p4 server -% create a client spec -Client hg-p4-import saved. -% populate the depot -//depot/test-mercurial-import/file_text#1 - opened for add -//depot/test-mercurial-import/file_binary#1 - opened for add -//depot/test-mercurial-import/target_symlink#1 - opened for add -//depot/test-mercurial-import/file_symlink#1 - opened for add -//depot/test-mercurial-import/file_text+m#1 - opened for add -//depot/test-mercurial-import/file_text+w#1 - opened for add -//depot/test-mercurial-import/file_text+x#1 - opened for add -//depot/test-mercurial-import/file_text+k#1 - opened for add -//depot/test-mercurial-import/file_text+kx#1 - opened for add -//depot/test-mercurial-import/file_text+ko#1 - opened for add -//depot/test-mercurial-import/file_text+l#1 - opened for add -//depot/test-mercurial-import/file_text+c#1 - opened for add -//depot/test-mercurial-import/file_text+d#1 - opened for add -//depot/test-mercurial-import/file_text+f#1 - opened for add -//depot/test-mercurial-import/file_text+s#1 - opened for add -//depot/test-mercurial-import/file_text+s2#1 - opened for add -//depot/test-mercurial-import/file_binary+k#1 - opened for add -//depot/test-mercurial-import/file_binary+x#1 - opened for add -//depot/test-mercurial-import/file_binary+kx#1 - opened for add -//depot/test-mercurial-import/target_symlink+k#1 - opened for add -//depot/test-mercurial-import/file_symlink+k#1 - opened for add -//depot/test-mercurial-import/file_ctext#1 - opened for add -//depot/test-mercurial-import/file_cxtext#1 - opened for add -//depot/test-mercurial-import/file_ktext#1 - opened for add -//depot/test-mercurial-import/file_kxtext#1 - opened for add -//depot/test-mercurial-import/file_ltext#1 - opened for add -//depot/test-mercurial-import/file_tempobj#1 - opened for add -//depot/test-mercurial-import/file_ubinary#1 - opened for add -//depot/test-mercurial-import/file_uxbinary#1 - opened for add -//depot/test-mercurial-import/file_xbinary#1 - opened for add -//depot/test-mercurial-import/file_xltext#1 - opened for add -//depot/test-mercurial-import/file_xtempobj#1 - opened for add -//depot/test-mercurial-import/file_xtext#1 - opened for add -Submitting change 1. -Locking 33 files ... -add //depot/test-mercurial-import/file_binary#1 -add //depot/test-mercurial-import/file_binary+k#1 -add //depot/test-mercurial-import/file_binary+kx#1 -add //depot/test-mercurial-import/file_binary+x#1 -add //depot/test-mercurial-import/file_ctext#1 -add //depot/test-mercurial-import/file_cxtext#1 -add //depot/test-mercurial-import/file_ktext#1 -add //depot/test-mercurial-import/file_kxtext#1 -add //depot/test-mercurial-import/file_ltext#1 -add //depot/test-mercurial-import/file_symlink#1 -add //depot/test-mercurial-import/file_symlink+k#1 -add //depot/test-mercurial-import/file_tempobj#1 -add //depot/test-mercurial-import/file_text#1 -add //depot/test-mercurial-import/file_text+c#1 -add //depot/test-mercurial-import/file_text+d#1 -add //depot/test-mercurial-import/file_text+f#1 -add //depot/test-mercurial-import/file_text+k#1 -add //depot/test-mercurial-import/file_text+ko#1 -add //depot/test-mercurial-import/file_text+kx#1 -add //depot/test-mercurial-import/file_text+l#1 -add //depot/test-mercurial-import/file_text+m#1 -add //depot/test-mercurial-import/file_text+s#1 -add //depot/test-mercurial-import/file_text+s2#1 -add //depot/test-mercurial-import/file_text+w#1 -add //depot/test-mercurial-import/file_text+x#1 -add //depot/test-mercurial-import/file_ubinary#1 -add //depot/test-mercurial-import/file_uxbinary#1 -add //depot/test-mercurial-import/file_xbinary#1 -add //depot/test-mercurial-import/file_xltext#1 -add //depot/test-mercurial-import/file_xtempobj#1 -add //depot/test-mercurial-import/file_xtext#1 -add //depot/test-mercurial-import/target_symlink#1 -add //depot/test-mercurial-import/target_symlink+k#1 -Change 1 submitted. -//depot/test-mercurial-import/file_binary+k#1 - refreshing -//depot/test-mercurial-import/file_binary+kx#1 - refreshing -//depot/test-mercurial-import/file_ktext#1 - refreshing -//depot/test-mercurial-import/file_kxtext#1 - refreshing -//depot/test-mercurial-import/file_symlink+k#1 - refreshing -//depot/test-mercurial-import/file_text+k#1 - refreshing -//depot/test-mercurial-import/file_text+ko#1 - refreshing -//depot/test-mercurial-import/file_text+kx#1 - refreshing -% test keyword expansion -//depot/test-mercurial-import/file_binary#1 - opened for edit -//depot/test-mercurial-import/file_binary+k#1 - opened for edit -//depot/test-mercurial-import/file_binary+kx#1 - opened for edit -//depot/test-mercurial-import/file_binary+x#1 - opened for edit -//depot/test-mercurial-import/file_ctext#1 - opened for edit -//depot/test-mercurial-import/file_cxtext#1 - opened for edit -//depot/test-mercurial-import/file_ktext#1 - opened for edit -//depot/test-mercurial-import/file_kxtext#1 - opened for edit -//depot/test-mercurial-import/file_ltext#1 - opened for edit -//depot/test-mercurial-import/file_symlink#1 - opened for edit -//depot/test-mercurial-import/file_symlink+k#1 - opened for edit -//depot/test-mercurial-import/file_tempobj#1 - opened for edit -//depot/test-mercurial-import/file_text#1 - opened for edit -//depot/test-mercurial-import/file_text+c#1 - opened for edit -//depot/test-mercurial-import/file_text+d#1 - opened for edit -//depot/test-mercurial-import/file_text+f#1 - opened for edit -//depot/test-mercurial-import/file_text+k#1 - opened for edit -//depot/test-mercurial-import/file_text+ko#1 - opened for edit -//depot/test-mercurial-import/file_text+kx#1 - opened for edit -//depot/test-mercurial-import/file_text+l#1 - opened for edit -//depot/test-mercurial-import/file_text+m#1 - opened for edit -//depot/test-mercurial-import/file_text+s#1 - opened for edit -//depot/test-mercurial-import/file_text+s2#1 - opened for edit -//depot/test-mercurial-import/file_text+w#1 - opened for edit -//depot/test-mercurial-import/file_text+x#1 - opened for edit -//depot/test-mercurial-import/file_ubinary#1 - opened for edit -//depot/test-mercurial-import/file_uxbinary#1 - opened for edit -//depot/test-mercurial-import/file_xbinary#1 - opened for edit -//depot/test-mercurial-import/file_xltext#1 - opened for edit -//depot/test-mercurial-import/file_xtempobj#1 - opened for edit -//depot/test-mercurial-import/file_xtext#1 - opened for edit -//depot/test-mercurial-import/target_symlink#1 - opened for edit -//depot/test-mercurial-import/target_symlink+k#1 - opened for edit -//depot/test-mercurial-import/crazy_symlink+k#1 - opened for add -Submitting change 2. -Locking 34 files ... -add //depot/test-mercurial-import/crazy_symlink+k#1 -edit //depot/test-mercurial-import/file_binary#2 -edit //depot/test-mercurial-import/file_binary+k#2 -edit //depot/test-mercurial-import/file_binary+kx#2 -edit //depot/test-mercurial-import/file_binary+x#2 -edit //depot/test-mercurial-import/file_ctext#2 -edit //depot/test-mercurial-import/file_cxtext#2 -edit //depot/test-mercurial-import/file_ktext#2 -edit //depot/test-mercurial-import/file_kxtext#2 -edit //depot/test-mercurial-import/file_ltext#2 -edit //depot/test-mercurial-import/file_symlink#2 -edit //depot/test-mercurial-import/file_symlink+k#2 -edit //depot/test-mercurial-import/file_tempobj#2 -edit //depot/test-mercurial-import/file_text#2 -edit //depot/test-mercurial-import/file_text+c#2 -edit //depot/test-mercurial-import/file_text+d#2 -edit //depot/test-mercurial-import/file_text+f#2 -edit //depot/test-mercurial-import/file_text+k#2 -edit //depot/test-mercurial-import/file_text+ko#2 -edit //depot/test-mercurial-import/file_text+kx#2 -edit //depot/test-mercurial-import/file_text+l#2 -edit //depot/test-mercurial-import/file_text+m#2 -edit //depot/test-mercurial-import/file_text+s#2 -edit //depot/test-mercurial-import/file_text+s2#2 -edit //depot/test-mercurial-import/file_text+w#2 -edit //depot/test-mercurial-import/file_text+x#2 -edit //depot/test-mercurial-import/file_ubinary#2 -edit //depot/test-mercurial-import/file_uxbinary#2 -edit //depot/test-mercurial-import/file_xbinary#2 -edit //depot/test-mercurial-import/file_xltext#2 -edit //depot/test-mercurial-import/file_xtempobj#2 -edit //depot/test-mercurial-import/file_xtext#2 -edit //depot/test-mercurial-import/target_symlink#2 -edit //depot/test-mercurial-import/target_symlink+k#2 -Change 2 submitted. -//depot/test-mercurial-import/crazy_symlink+k#1 - refreshing -//depot/test-mercurial-import/file_binary+k#2 - refreshing -//depot/test-mercurial-import/file_binary+kx#2 - refreshing -//depot/test-mercurial-import/file_ktext#2 - refreshing -//depot/test-mercurial-import/file_kxtext#2 - refreshing -//depot/test-mercurial-import/file_symlink+k#2 - refreshing -//depot/test-mercurial-import/file_text+k#2 - refreshing -//depot/test-mercurial-import/file_text+ko#2 - refreshing -//depot/test-mercurial-import/file_text+kx#2 - refreshing -% check keywords in p4 -file_binary:$Header$ -file_binary:$Header$$Header$Header$ -file_binary+k:$Header: //depot/test-mercurial-import/file_binary+k#2 $ -file_binary+k:$Header: //depot/test-mercurial-import/file_binary+k#2 $$Header: //depot/test-mercurial-import/file_binary+k#2 $Header$ -file_binary+kx:$Header: //depot/test-mercurial-import/file_binary+kx#2 $ -file_binary+kx:$Header: //depot/test-mercurial-import/file_binary+kx#2 $$Header: //depot/test-mercurial-import/file_binary+kx#2 $Header$ -file_binary+x:$Header$ -file_binary+x:$Header$$Header$Header$ -file_ctext:$Header$ -file_ctext:$Header$$Header$Header$ -file_cxtext:$Header$ -file_cxtext:$Header$$Header$Header$ -file_ktext:$Header: //depot/test-mercurial-import/file_ktext#2 $ -file_ktext:$Header: //depot/test-mercurial-import/file_ktext#2 $$Header: //depot/test-mercurial-import/file_ktext#2 $Header$ -file_kxtext:$Header: //depot/test-mercurial-import/file_kxtext#2 $ -file_kxtext:$Header: //depot/test-mercurial-import/file_kxtext#2 $$Header: //depot/test-mercurial-import/file_kxtext#2 $Header$ -file_ltext:$Header$ -file_ltext:$Header$$Header$Header$ -file_symlink:$Header$ -file_symlink:$Header$$Header$Header$ -file_symlink+k:$Header$ -file_symlink+k:$Header$$Header$Header$ -file_tempobj:$Header$ -file_tempobj:$Header$$Header$Header$ -file_text:$Header$ -file_text:$Header$$Header$Header$ -file_text+c:$Header$ -file_text+c:$Header$$Header$Header$ -file_text+d:$Header$ -file_text+d:$Header$$Header$Header$ -file_text+f:$Header$ -file_text+f:$Header$$Header$Header$ -file_text+k:$Header: //depot/test-mercurial-import/file_text+k#2 $ -file_text+k:$Header: //depot/test-mercurial-import/file_text+k#2 $$Header: //depot/test-mercurial-import/file_text+k#2 $Header$ -file_text+ko:$Header: //depot/test-mercurial-import/file_text+ko#2 $ -file_text+ko:$Header: //depot/test-mercurial-import/file_text+ko#2 $$Header: //depot/test-mercurial-import/file_text+ko#2 $Header$ -file_text+kx:$Header: //depot/test-mercurial-import/file_text+kx#2 $ -file_text+kx:$Header: //depot/test-mercurial-import/file_text+kx#2 $$Header: //depot/test-mercurial-import/file_text+kx#2 $Header$ -file_text+l:$Header$ -file_text+l:$Header$$Header$Header$ -file_text+m:$Header$ -file_text+m:$Header$$Header$Header$ -file_text+s:$Header$ -file_text+s:$Header$$Header$Header$ -file_text+s2:$Header$ -file_text+s2:$Header$$Header$Header$ -file_text+w:$Header$ -file_text+w:$Header$$Header$Header$ -file_text+x:$Header$ -file_text+x:$Header$$Header$Header$ -file_ubinary:$Header$ -file_ubinary:$Header$$Header$Header$ -file_uxbinary:$Header$ -file_uxbinary:$Header$$Header$Header$ -file_xbinary:$Header$ -file_xbinary:$Header$$Header$Header$ -file_xltext:$Header$ -file_xltext:$Header$$Header$Header$ -file_xtempobj:$Header$ -file_xtempobj:$Header$$Header$Header$ -file_xtext:$Header$ -file_xtext:$Header$$Header$Header$ -% convert -initializing destination dst repository -reading p4 views -collecting p4 changelists -1 initial -2 keywords -scanning source... -sorting... -converting... -1 initial -0 keywords -rev=1 desc="keywords" tags="tip" files="crazy_symlink+k file_binary file_binary+k file_binary+kx file_binary+x file_ctext file_cxtext file_ktext file_kxtext file_ltext file_text file_text+c file_text+d file_text+f file_text+k file_text+ko file_text+kx file_text+l file_text+m file_text+s file_text+s2 file_text+w file_text+x file_ubinary file_uxbinary file_xbinary file_xltext file_xtext target_symlink target_symlink+k" -grev=0 desc="initial" tags="" files="file_binary file_binary+k file_binary+kx file_binary+x file_ctext file_cxtext file_ktext file_kxtext file_ltext file_symlink file_symlink+k file_text file_text+c file_text+d file_text+f file_text+k file_text+ko file_text+kx file_text+l file_text+m file_text+s2 file_text+w file_text+x file_ubinary file_uxbinary file_xbinary file_xltext file_xtext target_symlink target_symlink+k" -g% revision 0 -30 files updated, 0 files merged, 0 files removed, 0 files unresolved -==> dst/file_binary <== -this is binary -==> dst/file_binary+k <== -this is binary+k -==> dst/file_binary+kx <== -this is binary+kx -==> dst/file_binary+x <== -this is binary+x -==> dst/file_ctext <== -this is ctext - -==> dst/file_cxtext <== -this is cxtext - -==> dst/file_ktext <== -this is ktext - -==> dst/file_kxtext <== -this is kxtext - -==> dst/file_ltext <== -this is ltext - -==> dst/file_symlink <== -this is target symlink - -==> dst/file_symlink+k <== -this is target symlink+k - -==> dst/file_text <== -this is text - -==> dst/file_text+c <== -this is text+C - -==> dst/file_text+d <== -this is text+D - -==> dst/file_text+f <== -this is text+F - -==> dst/file_text+k <== -this is text+k - -==> dst/file_text+ko <== -this is text+ko - -==> dst/file_text+kx <== -this is text+kx - -==> dst/file_text+l <== -this is text+l - -==> dst/file_text+m <== -this is text+m - -==> dst/file_text+s2 <== -this is text+S2 - -==> dst/file_text+w <== -this is text+w - -==> dst/file_text+x <== -this is text+x - -==> dst/file_ubinary <== -this is ubinary - -==> dst/file_uxbinary <== -this is uxbinary - -==> dst/file_xbinary <== -this is xbinary - -==> dst/file_xltext <== -this is xltext - -==> dst/file_xtext <== -this is xtext - -% revision 1 -30 files updated, 0 files merged, 0 files removed, 0 files unresolved -==> dst/file_binary <== -this is binary$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_binary+k <== -this is binary+k$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_binary+kx <== -this is binary+kx$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_binary+x <== -this is binary+x$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_ctext <== -this is ctext -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_cxtext <== -this is cxtext -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_ktext <== -this is ktext -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_kxtext <== -this is kxtext -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_ltext <== -this is ltext -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_symlink <== -this is target symlink -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_symlink+k <== -this is target symlink+k -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text <== -this is text -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+c <== -this is text+C -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+d <== -this is text+D -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+f <== -this is text+F -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+k <== -this is text+k -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+ko <== -this is text+ko -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+kx <== -this is text+kx -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+l <== -this is text+l -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+m <== -this is text+m -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+s <== -this is text+S -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+s2 <== -this is text+S2 -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+w <== -this is text+w -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_text+x <== -this is text+x -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_ubinary <== -this is ubinary -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_uxbinary <== -this is uxbinary -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_xbinary <== -this is xbinary -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_xltext <== -this is xltext -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -==> dst/file_xtext <== -this is xtext -$Id$ -$Header$ -$Date$ -$DateTime$ -$Change$ -$File$ -$Revision$ -$Header$$Header$Header$ - -% crazy_symlink -target_$Header: //depot/test-mercurial-import/crazy_symlink+k#1 $ -target_$Header$ -% stop the p4 server
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-convert-p4-filetypes.t Sat May 12 13:20:26 2012 +0200 @@ -0,0 +1,733 @@ + $ "$TESTDIR/hghave" p4 execbit symlink || exit 80 + + $ echo "[extensions]" >> $HGRCPATH + $ echo "convert = " >> $HGRCPATH + +create p4 depot + $ P4ROOT=`pwd`/depot; export P4ROOT + $ P4AUDIT=$P4ROOT/audit; export P4AUDIT + $ P4JOURNAL=$P4ROOT/journal; export P4JOURNAL + $ P4LOG=$P4ROOT/log; export P4LOG + $ P4PORT=localhost:16661; export P4PORT + $ P4DEBUG=1; export P4DEBUG + $ P4CHARSET=utf8; export P4CHARSET + +start the p4 server + $ [ ! -d $P4ROOT ] && mkdir $P4ROOT + $ p4d -f -J off -xi >$P4ROOT/stdout 2>$P4ROOT/stderr + $ p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & + $ echo $! >> $DAEMON_PIDS + $ trap "echo stopping the p4 server ; p4 admin stop" EXIT + +wait for the server to initialize + $ while ! p4 ; do + > sleep 1 + > done >/dev/null 2>/dev/null + +create a client spec + $ P4CLIENT=hg-p4-import; export P4CLIENT + $ DEPOTPATH=//depot/test-mercurial-import/... + $ p4 client -o | sed '/^View:/,$ d' >p4client + $ echo View: >>p4client + $ echo " $DEPOTPATH //$P4CLIENT/..." >>p4client + $ p4 client -i <p4client + Client hg-p4-import saved. + +populate the depot + $ TYPES="text binary symlink" + $ TYPES="$TYPES text+m text+w text+x text+k text+kx text+ko text+l text+C text+D text+F text+S text+S2" + $ TYPES="$TYPES binary+k binary+x binary+kx symlink+k" + $ TYPES="$TYPES ctext cxtext ktext kxtext ltext tempobj ubinary uxbinary xbinary xltext xtempobj xtext" +not testing these + $ #TYPES="$TYPES apple resource unicode utf16 uresource xunicode xutf16" + $ for T in $TYPES ; do + > T2=`echo $T | tr [:upper:] [:lower:]` + > case $T in + > apple) + > ;; + > symlink*) + > echo "this is target $T" >target_$T2 + > ln -s target_$T file_$T2 + > p4 add target_$T2 + > p4 add -t $T file_$T2 + > ;; + > binary*) + > python -c "file('file_$T2', 'wb').write('this is $T')" + > p4 add -t $T file_$T2 + > ;; + > *) + > echo "this is $T" >file_$T2 + > p4 add -t $T file_$T2 + > ;; + > esac + > done + //depot/test-mercurial-import/file_text#1 - opened for add + //depot/test-mercurial-import/file_binary#1 - opened for add + //depot/test-mercurial-import/target_symlink#1 - opened for add + //depot/test-mercurial-import/file_symlink#1 - opened for add + //depot/test-mercurial-import/file_text+m#1 - opened for add + //depot/test-mercurial-import/file_text+w#1 - opened for add + //depot/test-mercurial-import/file_text+x#1 - opened for add + //depot/test-mercurial-import/file_text+k#1 - opened for add + //depot/test-mercurial-import/file_text+kx#1 - opened for add + //depot/test-mercurial-import/file_text+ko#1 - opened for add + //depot/test-mercurial-import/file_text+l#1 - opened for add + //depot/test-mercurial-import/file_text+c#1 - opened for add + //depot/test-mercurial-import/file_text+d#1 - opened for add + //depot/test-mercurial-import/file_text+f#1 - opened for add + //depot/test-mercurial-import/file_text+s#1 - opened for add + //depot/test-mercurial-import/file_text+s2#1 - opened for add + //depot/test-mercurial-import/file_binary+k#1 - opened for add + //depot/test-mercurial-import/file_binary+x#1 - opened for add + //depot/test-mercurial-import/file_binary+kx#1 - opened for add + //depot/test-mercurial-import/target_symlink+k#1 - opened for add + //depot/test-mercurial-import/file_symlink+k#1 - opened for add + //depot/test-mercurial-import/file_ctext#1 - opened for add + //depot/test-mercurial-import/file_cxtext#1 - opened for add + //depot/test-mercurial-import/file_ktext#1 - opened for add + //depot/test-mercurial-import/file_kxtext#1 - opened for add + //depot/test-mercurial-import/file_ltext#1 - opened for add + //depot/test-mercurial-import/file_tempobj#1 - opened for add + //depot/test-mercurial-import/file_ubinary#1 - opened for add + //depot/test-mercurial-import/file_uxbinary#1 - opened for add + //depot/test-mercurial-import/file_xbinary#1 - opened for add + //depot/test-mercurial-import/file_xltext#1 - opened for add + //depot/test-mercurial-import/file_xtempobj#1 - opened for add + //depot/test-mercurial-import/file_xtext#1 - opened for add + $ p4 submit -d initial + Submitting change 1. + Locking 33 files ... + add //depot/test-mercurial-import/file_binary#1 + add //depot/test-mercurial-import/file_binary+k#1 + add //depot/test-mercurial-import/file_binary+kx#1 + add //depot/test-mercurial-import/file_binary+x#1 + add //depot/test-mercurial-import/file_ctext#1 + add //depot/test-mercurial-import/file_cxtext#1 + add //depot/test-mercurial-import/file_ktext#1 + add //depot/test-mercurial-import/file_kxtext#1 + add //depot/test-mercurial-import/file_ltext#1 + add //depot/test-mercurial-import/file_symlink#1 + add //depot/test-mercurial-import/file_symlink+k#1 + add //depot/test-mercurial-import/file_tempobj#1 + add //depot/test-mercurial-import/file_text#1 + add //depot/test-mercurial-import/file_text+c#1 + add //depot/test-mercurial-import/file_text+d#1 + add //depot/test-mercurial-import/file_text+f#1 + add //depot/test-mercurial-import/file_text+k#1 + add //depot/test-mercurial-import/file_text+ko#1 + add //depot/test-mercurial-import/file_text+kx#1 + add //depot/test-mercurial-import/file_text+l#1 + add //depot/test-mercurial-import/file_text+m#1 + add //depot/test-mercurial-import/file_text+s#1 + add //depot/test-mercurial-import/file_text+s2#1 + add //depot/test-mercurial-import/file_text+w#1 + add //depot/test-mercurial-import/file_text+x#1 + add //depot/test-mercurial-import/file_ubinary#1 + add //depot/test-mercurial-import/file_uxbinary#1 + add //depot/test-mercurial-import/file_xbinary#1 + add //depot/test-mercurial-import/file_xltext#1 + add //depot/test-mercurial-import/file_xtempobj#1 + add //depot/test-mercurial-import/file_xtext#1 + add //depot/test-mercurial-import/target_symlink#1 + add //depot/test-mercurial-import/target_symlink+k#1 + Change 1 submitted. + //depot/test-mercurial-import/file_binary+k#1 - refreshing + //depot/test-mercurial-import/file_binary+kx#1 - refreshing + //depot/test-mercurial-import/file_ktext#1 - refreshing + //depot/test-mercurial-import/file_kxtext#1 - refreshing + //depot/test-mercurial-import/file_symlink+k#1 - refreshing + //depot/test-mercurial-import/file_text+k#1 - refreshing + //depot/test-mercurial-import/file_text+ko#1 - refreshing + //depot/test-mercurial-import/file_text+kx#1 - refreshing + +test keyword expansion + $ p4 edit file_* target_* + //depot/test-mercurial-import/file_binary#1 - opened for edit + //depot/test-mercurial-import/file_binary+k#1 - opened for edit + //depot/test-mercurial-import/file_binary+kx#1 - opened for edit + //depot/test-mercurial-import/file_binary+x#1 - opened for edit + //depot/test-mercurial-import/file_ctext#1 - opened for edit + //depot/test-mercurial-import/file_cxtext#1 - opened for edit + //depot/test-mercurial-import/file_ktext#1 - opened for edit + //depot/test-mercurial-import/file_kxtext#1 - opened for edit + //depot/test-mercurial-import/file_ltext#1 - opened for edit + //depot/test-mercurial-import/file_symlink#1 - opened for edit + //depot/test-mercurial-import/file_symlink+k#1 - opened for edit + //depot/test-mercurial-import/file_tempobj#1 - opened for edit + //depot/test-mercurial-import/file_text#1 - opened for edit + //depot/test-mercurial-import/file_text+c#1 - opened for edit + //depot/test-mercurial-import/file_text+d#1 - opened for edit + //depot/test-mercurial-import/file_text+f#1 - opened for edit + //depot/test-mercurial-import/file_text+k#1 - opened for edit + //depot/test-mercurial-import/file_text+ko#1 - opened for edit + //depot/test-mercurial-import/file_text+kx#1 - opened for edit + //depot/test-mercurial-import/file_text+l#1 - opened for edit + //depot/test-mercurial-import/file_text+m#1 - opened for edit + //depot/test-mercurial-import/file_text+s#1 - opened for edit + //depot/test-mercurial-import/file_text+s2#1 - opened for edit + //depot/test-mercurial-import/file_text+w#1 - opened for edit + //depot/test-mercurial-import/file_text+x#1 - opened for edit + //depot/test-mercurial-import/file_ubinary#1 - opened for edit + //depot/test-mercurial-import/file_uxbinary#1 - opened for edit + //depot/test-mercurial-import/file_xbinary#1 - opened for edit + //depot/test-mercurial-import/file_xltext#1 - opened for edit + //depot/test-mercurial-import/file_xtempobj#1 - opened for edit + //depot/test-mercurial-import/file_xtext#1 - opened for edit + //depot/test-mercurial-import/target_symlink#1 - opened for edit + //depot/test-mercurial-import/target_symlink+k#1 - opened for edit + $ for T in $TYPES ; do + > T2=`echo $T | tr [:upper:] [:lower:]` + > echo '$Id$' >>file_$T2 + > echo '$Header$' >>file_$T2 + > echo '$Date$' >>file_$T2 + > echo '$DateTime$' >>file_$T2 + > echo '$Change$' >>file_$T2 + > echo '$File$' >>file_$T2 + > echo '$Revision$' >>file_$T2 + > echo '$Header$$Header$Header$' >>file_$T2 + > done + + $ ln -s 'target_$Header$' crazy_symlink+k + $ p4 add -t symlink+k crazy_symlink+k + //depot/test-mercurial-import/crazy_symlink+k#1 - opened for add + + $ p4 submit -d keywords + Submitting change 2. + Locking 34 files ... + add //depot/test-mercurial-import/crazy_symlink+k#1 + edit //depot/test-mercurial-import/file_binary#2 + edit //depot/test-mercurial-import/file_binary+k#2 + edit //depot/test-mercurial-import/file_binary+kx#2 + edit //depot/test-mercurial-import/file_binary+x#2 + edit //depot/test-mercurial-import/file_ctext#2 + edit //depot/test-mercurial-import/file_cxtext#2 + edit //depot/test-mercurial-import/file_ktext#2 + edit //depot/test-mercurial-import/file_kxtext#2 + edit //depot/test-mercurial-import/file_ltext#2 + edit //depot/test-mercurial-import/file_symlink#2 + edit //depot/test-mercurial-import/file_symlink+k#2 + edit //depot/test-mercurial-import/file_tempobj#2 + edit //depot/test-mercurial-import/file_text#2 + edit //depot/test-mercurial-import/file_text+c#2 + edit //depot/test-mercurial-import/file_text+d#2 + edit //depot/test-mercurial-import/file_text+f#2 + edit //depot/test-mercurial-import/file_text+k#2 + edit //depot/test-mercurial-import/file_text+ko#2 + edit //depot/test-mercurial-import/file_text+kx#2 + edit //depot/test-mercurial-import/file_text+l#2 + edit //depot/test-mercurial-import/file_text+m#2 + edit //depot/test-mercurial-import/file_text+s#2 + edit //depot/test-mercurial-import/file_text+s2#2 + edit //depot/test-mercurial-import/file_text+w#2 + edit //depot/test-mercurial-import/file_text+x#2 + edit //depot/test-mercurial-import/file_ubinary#2 + edit //depot/test-mercurial-import/file_uxbinary#2 + edit //depot/test-mercurial-import/file_xbinary#2 + edit //depot/test-mercurial-import/file_xltext#2 + edit //depot/test-mercurial-import/file_xtempobj#2 + edit //depot/test-mercurial-import/file_xtext#2 + edit //depot/test-mercurial-import/target_symlink#2 + edit //depot/test-mercurial-import/target_symlink+k#2 + Change 2 submitted. + //depot/test-mercurial-import/crazy_symlink+k#1 - refreshing + //depot/test-mercurial-import/file_binary+k#2 - refreshing + //depot/test-mercurial-import/file_binary+kx#2 - refreshing + //depot/test-mercurial-import/file_ktext#2 - refreshing + //depot/test-mercurial-import/file_kxtext#2 - refreshing + //depot/test-mercurial-import/file_symlink+k#2 - refreshing + //depot/test-mercurial-import/file_text+k#2 - refreshing + //depot/test-mercurial-import/file_text+ko#2 - refreshing + //depot/test-mercurial-import/file_text+kx#2 - refreshing + +check keywords in p4 + $ grep -H Header file_* + file_binary:$Header$ + file_binary:$Header$$Header$Header$ + file_binary+k:$Header: //depot/test-mercurial-import/file_binary+k#2 $ + file_binary+k:$Header: //depot/test-mercurial-import/file_binary+k#2 $$Header: //depot/test-mercurial-import/file_binary+k#2 $Header$ + file_binary+kx:$Header: //depot/test-mercurial-import/file_binary+kx#2 $ + file_binary+kx:$Header: //depot/test-mercurial-import/file_binary+kx#2 $$Header: //depot/test-mercurial-import/file_binary+kx#2 $Header$ + file_binary+x:$Header$ + file_binary+x:$Header$$Header$Header$ + file_ctext:$Header$ + file_ctext:$Header$$Header$Header$ + file_cxtext:$Header$ + file_cxtext:$Header$$Header$Header$ + file_ktext:$Header: //depot/test-mercurial-import/file_ktext#2 $ + file_ktext:$Header: //depot/test-mercurial-import/file_ktext#2 $$Header: //depot/test-mercurial-import/file_ktext#2 $Header$ + file_kxtext:$Header: //depot/test-mercurial-import/file_kxtext#2 $ + file_kxtext:$Header: //depot/test-mercurial-import/file_kxtext#2 $$Header: //depot/test-mercurial-import/file_kxtext#2 $Header$ + file_ltext:$Header$ + file_ltext:$Header$$Header$Header$ + file_symlink:$Header$ + file_symlink:$Header$$Header$Header$ + file_symlink+k:$Header$ + file_symlink+k:$Header$$Header$Header$ + file_tempobj:$Header$ + file_tempobj:$Header$$Header$Header$ + file_text:$Header$ + file_text:$Header$$Header$Header$ + file_text+c:$Header$ + file_text+c:$Header$$Header$Header$ + file_text+d:$Header$ + file_text+d:$Header$$Header$Header$ + file_text+f:$Header$ + file_text+f:$Header$$Header$Header$ + file_text+k:$Header: //depot/test-mercurial-import/file_text+k#2 $ + file_text+k:$Header: //depot/test-mercurial-import/file_text+k#2 $$Header: //depot/test-mercurial-import/file_text+k#2 $Header$ + file_text+ko:$Header: //depot/test-mercurial-import/file_text+ko#2 $ + file_text+ko:$Header: //depot/test-mercurial-import/file_text+ko#2 $$Header: //depot/test-mercurial-import/file_text+ko#2 $Header$ + file_text+kx:$Header: //depot/test-mercurial-import/file_text+kx#2 $ + file_text+kx:$Header: //depot/test-mercurial-import/file_text+kx#2 $$Header: //depot/test-mercurial-import/file_text+kx#2 $Header$ + file_text+l:$Header$ + file_text+l:$Header$$Header$Header$ + file_text+m:$Header$ + file_text+m:$Header$$Header$Header$ + file_text+s:$Header$ + file_text+s:$Header$$Header$Header$ + file_text+s2:$Header$ + file_text+s2:$Header$$Header$Header$ + file_text+w:$Header$ + file_text+w:$Header$$Header$Header$ + file_text+x:$Header$ + file_text+x:$Header$$Header$Header$ + file_ubinary:$Header$ + file_ubinary:$Header$$Header$Header$ + file_uxbinary:$Header$ + file_uxbinary:$Header$$Header$Header$ + file_xbinary:$Header$ + file_xbinary:$Header$$Header$Header$ + file_xltext:$Header$ + file_xltext:$Header$$Header$Header$ + file_xtempobj:$Header$ + file_xtempobj:$Header$$Header$Header$ + file_xtext:$Header$ + file_xtext:$Header$$Header$Header$ + +convert + $ hg convert -s p4 $DEPOTPATH dst + initializing destination dst repository + reading p4 views + collecting p4 changelists + 1 initial + 2 keywords + scanning source... + sorting... + converting... + 1 initial + 0 keywords + $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' + rev=1 desc="keywords" tags="tip" files="crazy_symlink+k file_binary file_binary+k file_binary+kx file_binary+x file_ctext file_cxtext file_ktext file_kxtext file_ltext file_text file_text+c file_text+d file_text+f file_text+k file_text+ko file_text+kx file_text+l file_text+m file_text+s file_text+s2 file_text+w file_text+x file_ubinary file_uxbinary file_xbinary file_xltext file_xtext target_symlink target_symlink+k" + rev=0 desc="initial" tags="" files="file_binary file_binary+k file_binary+kx file_binary+x file_ctext file_cxtext file_ktext file_kxtext file_ltext file_symlink file_symlink+k file_text file_text+c file_text+d file_text+f file_text+k file_text+ko file_text+kx file_text+l file_text+m file_text+s2 file_text+w file_text+x file_ubinary file_uxbinary file_xbinary file_xltext file_xtext target_symlink target_symlink+k" + +revision 0 + $ hg -R dst update 0 + 30 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ head dst/file_* | cat -v + ==> dst/file_binary <== + this is binary + ==> dst/file_binary+k <== + this is binary+k + ==> dst/file_binary+kx <== + this is binary+kx + ==> dst/file_binary+x <== + this is binary+x + ==> dst/file_ctext <== + this is ctext + + ==> dst/file_cxtext <== + this is cxtext + + ==> dst/file_ktext <== + this is ktext + + ==> dst/file_kxtext <== + this is kxtext + + ==> dst/file_ltext <== + this is ltext + + ==> dst/file_symlink <== + this is target symlink + + ==> dst/file_symlink+k <== + this is target symlink+k + + ==> dst/file_text <== + this is text + + ==> dst/file_text+c <== + this is text+C + + ==> dst/file_text+d <== + this is text+D + + ==> dst/file_text+f <== + this is text+F + + ==> dst/file_text+k <== + this is text+k + + ==> dst/file_text+ko <== + this is text+ko + + ==> dst/file_text+kx <== + this is text+kx + + ==> dst/file_text+l <== + this is text+l + + ==> dst/file_text+m <== + this is text+m + + ==> dst/file_text+s2 <== + this is text+S2 + + ==> dst/file_text+w <== + this is text+w + + ==> dst/file_text+x <== + this is text+x + + ==> dst/file_ubinary <== + this is ubinary + + ==> dst/file_uxbinary <== + this is uxbinary + + ==> dst/file_xbinary <== + this is xbinary + + ==> dst/file_xltext <== + this is xltext + + ==> dst/file_xtext <== + this is xtext + +revision 1 + $ hg -R dst update 1 + 30 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ head dst/file_* | cat -v + ==> dst/file_binary <== + this is binary$Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_binary+k <== + this is binary+k$Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_binary+kx <== + this is binary+kx$Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_binary+x <== + this is binary+x$Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_ctext <== + this is ctext + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_cxtext <== + this is cxtext + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_ktext <== + this is ktext + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_kxtext <== + this is kxtext + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_ltext <== + this is ltext + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_symlink <== + this is target symlink + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_symlink+k <== + this is target symlink+k + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text <== + this is text + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+c <== + this is text+C + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+d <== + this is text+D + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+f <== + this is text+F + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+k <== + this is text+k + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+ko <== + this is text+ko + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+kx <== + this is text+kx + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+l <== + this is text+l + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+m <== + this is text+m + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+s <== + this is text+S + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+s2 <== + this is text+S2 + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+w <== + this is text+w + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_text+x <== + this is text+x + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_ubinary <== + this is ubinary + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_uxbinary <== + this is uxbinary + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_xbinary <== + this is xbinary + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_xltext <== + this is xltext + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + + ==> dst/file_xtext <== + this is xtext + $Id$ + $Header$ + $Date$ + $DateTime$ + $Change$ + $File$ + $Revision$ + $Header$$Header$Header$ + +crazy_symlink + $ readlink crazy_symlink+k + target_$Header: //depot/test-mercurial-import/crazy_symlink+k#1 $ + $ readlink dst/crazy_symlink+k + target_$Header$ + +exit trap: + stopping the p4 server
--- a/tests/test-convert-p4.out Sat May 12 10:55:08 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -% create p4 depot -% start the p4 server -% create a client spec -Client hg-p4-import saved. -% populate the depot -//depot/test-mercurial-import/a#1 - opened for add -//depot/test-mercurial-import/b/c#1 - opened for add -Submitting change 1. -Locking 2 files ... -add //depot/test-mercurial-import/a#1 -add //depot/test-mercurial-import/b/c#1 -Change 1 submitted. -% change some files -//depot/test-mercurial-import/a#1 - opened for edit -Submitting change 2. -Locking 1 files ... -edit //depot/test-mercurial-import/a#2 -Change 2 submitted. -//depot/test-mercurial-import/b/c#1 - opened for edit -Submitting change 3. -Locking 1 files ... -edit //depot/test-mercurial-import/b/c#2 -Change 3 submitted. -% convert -initializing destination dst repository -reading p4 views -collecting p4 changelists -1 initial -2 change a -3 change b/c -scanning source... -sorting... -converting... -2 initial -1 change a -0 change b/c -rev=2 desc="change b/c" tags="tip" files="b/c" -rev=1 desc="change a" tags="" files="a" -rev=0 desc="initial" tags="" files="a b/c" -% change some files -//depot/test-mercurial-import/a#2 - opened for edit -//depot/test-mercurial-import/b/c#2 - opened for edit -Submitting change 4. -Locking 2 files ... -edit //depot/test-mercurial-import/a#3 -edit //depot/test-mercurial-import/b/c#3 -Change 4 submitted. -% convert again -reading p4 views -collecting p4 changelists -1 initial -2 change a -3 change b/c -4 change a b/c -scanning source... -sorting... -converting... -0 change a b/c -rev=3 desc="change a b/c" tags="tip" files="a b/c" -rev=2 desc="change b/c" tags="" files="b/c" -rev=1 desc="change a" tags="" files="a" -rev=0 desc="initial" tags="" files="a b/c" -% interesting names -//depot/test-mercurial-import/d d#1 - opened for add -//depot/test-mercurial-import/ e/ f#1 - opened for add -Submitting change 5. -Locking 2 files ... -add //depot/test-mercurial-import/ e/ f#1 -add //depot/test-mercurial-import/d d#1 -Change 5 submitted. -% convert again -reading p4 views -collecting p4 changelists -1 initial -2 change a -3 change b/c -4 change a b/c -5 add d e f -scanning source... -sorting... -converting... -0 add d e f -rev=4 desc="add d e f" tags="tip" files=" e/ f d d" -rev=3 desc="change a b/c" tags="" files="a b/c" -rev=2 desc="change b/c" tags="" files="b/c" -rev=1 desc="change a" tags="" files="a" -rev=0 desc="initial" tags="" files="a b/c" -% stop the p4 server
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-convert-p4.t Sat May 12 13:20:26 2012 +0200 @@ -0,0 +1,152 @@ + $ "$TESTDIR/hghave" p4 || exit 80 + + $ echo "[extensions]" >> $HGRCPATH + $ echo "convert = " >> $HGRCPATH + +create p4 depot + $ P4ROOT=`pwd`/depot; export P4ROOT + $ P4AUDIT=$P4ROOT/audit; export P4AUDIT + $ P4JOURNAL=$P4ROOT/journal; export P4JOURNAL + $ P4LOG=$P4ROOT/log; export P4LOG + $ P4PORT=localhost:16661; export P4PORT + $ P4DEBUG=1; export P4DEBUG + +start the p4 server + $ [ ! -d $P4ROOT ] && mkdir $P4ROOT + $ p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & + $ echo $! >> $DAEMON_PIDS + $ trap "echo stopping the p4 server ; p4 admin stop" EXIT + + $ # wait for the server to initialize + $ while ! p4 ; do + > sleep 1 + > done >/dev/null 2>/dev/null + +create a client spec + $ P4CLIENT=hg-p4-import; export P4CLIENT + $ DEPOTPATH=//depot/test-mercurial-import/... + $ p4 client -o | sed '/^View:/,$ d' >p4client + $ echo View: >>p4client + $ echo " $DEPOTPATH //$P4CLIENT/..." >>p4client + $ p4 client -i <p4client + Client hg-p4-import saved. + +populate the depot + $ echo a > a + $ mkdir b + $ echo c > b/c + $ p4 add a b/c + //depot/test-mercurial-import/a#1 - opened for add + //depot/test-mercurial-import/b/c#1 - opened for add + $ p4 submit -d initial + Submitting change 1. + Locking 2 files ... + add //depot/test-mercurial-import/a#1 + add //depot/test-mercurial-import/b/c#1 + Change 1 submitted. + +change some files + $ p4 edit a + //depot/test-mercurial-import/a#1 - opened for edit + $ echo aa >> a + $ p4 submit -d "change a" + Submitting change 2. + Locking 1 files ... + edit //depot/test-mercurial-import/a#2 + Change 2 submitted. + + $ p4 edit b/c + //depot/test-mercurial-import/b/c#1 - opened for edit + $ echo cc >> b/c + $ p4 submit -d "change b/c" + Submitting change 3. + Locking 1 files ... + edit //depot/test-mercurial-import/b/c#2 + Change 3 submitted. + +convert + $ hg convert -s p4 $DEPOTPATH dst + initializing destination dst repository + reading p4 views + collecting p4 changelists + 1 initial + 2 change a + 3 change b/c + scanning source... + sorting... + converting... + 2 initial + 1 change a + 0 change b/c + $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' + rev=2 desc="change b/c" tags="tip" files="b/c" + rev=1 desc="change a" tags="" files="a" + rev=0 desc="initial" tags="" files="a b/c" + +change some files + $ p4 edit a b/c + //depot/test-mercurial-import/a#2 - opened for edit + //depot/test-mercurial-import/b/c#2 - opened for edit + $ echo aaa >> a + $ echo ccc >> b/c + $ p4 submit -d "change a b/c" + Submitting change 4. + Locking 2 files ... + edit //depot/test-mercurial-import/a#3 + edit //depot/test-mercurial-import/b/c#3 + Change 4 submitted. + +convert again + $ hg convert -s p4 $DEPOTPATH dst + reading p4 views + collecting p4 changelists + 1 initial + 2 change a + 3 change b/c + 4 change a b/c + scanning source... + sorting... + converting... + 0 change a b/c + $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' + rev=3 desc="change a b/c" tags="tip" files="a b/c" + rev=2 desc="change b/c" tags="" files="b/c" + rev=1 desc="change a" tags="" files="a" + rev=0 desc="initial" tags="" files="a b/c" + +interesting names + $ echo dddd > "d d" + $ mkdir " e" + $ echo fff >" e/ f" + $ p4 add "d d" " e/ f" + //depot/test-mercurial-import/d d#1 - opened for add + //depot/test-mercurial-import/ e/ f#1 - opened for add + $ p4 submit -d "add d e f" + Submitting change 5. + Locking 2 files ... + add //depot/test-mercurial-import/ e/ f#1 + add //depot/test-mercurial-import/d d#1 + Change 5 submitted. + +convert again + $ hg convert -s p4 $DEPOTPATH dst + reading p4 views + collecting p4 changelists + 1 initial + 2 change a + 3 change b/c + 4 change a b/c + 5 add d e f + scanning source... + sorting... + converting... + 0 add d e f + $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' + rev=4 desc="add d e f" tags="tip" files=" e/ f d d" + rev=3 desc="change a b/c" tags="" files="a b/c" + rev=2 desc="change b/c" tags="" files="b/c" + rev=1 desc="change a" tags="" files="a" + rev=0 desc="initial" tags="" files="a b/c" + +exit trap: + stopping the p4 server