Show More
@@ -45,12 +45,10 b' testpats = [' | |||||
45 | [ |
|
45 | [ | |
46 | (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"), |
|
46 | (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"), | |
47 | (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), |
|
47 | (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), | |
48 | (r'^function', "don't use 'function', use old style"), |
|
|||
49 | (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"), |
|
48 | (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"), | |
50 | (r'sed.*-i', "don't use 'sed -i', use a temporary file"), |
|
49 | (r'sed.*-i', "don't use 'sed -i', use a temporary file"), | |
51 | (r'echo.*\\n', "don't use 'echo \\n', use printf"), |
|
50 | (r'echo.*\\n', "don't use 'echo \\n', use printf"), | |
52 | (r'echo -n', "don't use 'echo -n', use printf"), |
|
51 | (r'echo -n', "don't use 'echo -n', use printf"), | |
53 | (r'^diff.*-\w*N', "don't use 'diff -N'"), |
|
|||
54 | (r'(^| )wc[^|]*$\n(?!.*\(re\))', "filter wc output"), |
|
52 | (r'(^| )wc[^|]*$\n(?!.*\(re\))', "filter wc output"), | |
55 | (r'head -c', "don't use 'head -c', use 'dd'"), |
|
53 | (r'head -c', "don't use 'head -c', use 'dd'"), | |
56 | (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"), |
|
54 | (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"), | |
@@ -62,10 +60,8 b' testpats = [' | |||||
62 | (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w', |
|
60 | (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w', | |
63 | "use egrep for extended grep syntax"), |
|
61 | "use egrep for extended grep syntax"), | |
64 | (r'/bin/', "don't use explicit paths for tools"), |
|
62 | (r'/bin/', "don't use explicit paths for tools"), | |
65 | (r'\$PWD', "don't use $PWD, use `pwd`"), |
|
|||
66 | (r'[^\n]\Z', "no trailing newline"), |
|
63 | (r'[^\n]\Z', "no trailing newline"), | |
67 | (r'export.*=', "don't export and assign at once"), |
|
64 | (r'export.*=', "don't export and assign at once"), | |
68 | (r'^([^"\'\n]|("[^"\n]*")|(\'[^\'\n]*\'))*\^', "^ must be quoted"), |
|
|||
69 | (r'^source\b', "don't use 'source', use '.'"), |
|
65 | (r'^source\b', "don't use 'source', use '.'"), | |
70 | (r'touch -d', "don't use 'touch -d', use 'touch -t' instead"), |
|
66 | (r'touch -d', "don't use 'touch -d', use 'touch -t' instead"), | |
71 | (r'ls +[^|\n-]+ +-', "options to 'ls' must come before filenames"), |
|
67 | (r'ls +[^|\n-]+ +-', "options to 'ls' must come before filenames"), | |
@@ -79,7 +75,12 b' testpats = [' | |||||
79 | (r'^( *)\t', "don't use tabs to indent"), |
|
75 | (r'^( *)\t', "don't use tabs to indent"), | |
80 | ], |
|
76 | ], | |
81 | # warnings |
|
77 | # warnings | |
82 |
[ |
|
78 | [ | |
|
79 | (r'^function', "don't use 'function', use old style"), | |||
|
80 | (r'^diff.*-\w*N', "don't use 'diff -N'"), | |||
|
81 | (r'\$PWD', "don't use $PWD, use `pwd`"), | |||
|
82 | (r'^([^"\'\n]|("[^"\n]*")|(\'[^\'\n]*\'))*\^', "^ must be quoted"), | |||
|
83 | ] | |||
83 | ] |
|
84 | ] | |
84 |
|
85 | |||
85 | testfilters = [ |
|
86 | testfilters = [ | |
@@ -91,7 +92,8 b' uprefix = r"^ \\$ "' | |||||
91 | utestpats = [ |
|
92 | utestpats = [ | |
92 | [ |
|
93 | [ | |
93 | (r'^(\S| $ ).*(\S[ \t]+|^[ \t]+)\n', "trailing whitespace on non-output"), |
|
94 | (r'^(\S| $ ).*(\S[ \t]+|^[ \t]+)\n', "trailing whitespace on non-output"), | |
94 | (uprefix + r'.*\|\s*sed', "use regex test output patterns instead of sed"), |
|
95 | (uprefix + r'.*\|\s*sed[^|>\n]*\n', | |
|
96 | "use regex test output patterns instead of sed"), | |||
95 | (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), |
|
97 | (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), | |
96 | (uprefix + r'.*(?<!\[)\$\?', "explicit exit code checks unnecessary"), |
|
98 | (uprefix + r'.*(?<!\[)\$\?', "explicit exit code checks unnecessary"), | |
97 | (uprefix + r'.*\|\| echo.*(fail|error)', |
|
99 | (uprefix + r'.*\|\| echo.*(fail|error)', | |
@@ -106,9 +108,9 b' utestpats = [' | |||||
106 | for i in [0, 1]: |
|
108 | for i in [0, 1]: | |
107 | for p, m in testpats[i]: |
|
109 | for p, m in testpats[i]: | |
108 | if p.startswith(r'^'): |
|
110 | if p.startswith(r'^'): | |
109 |
p = r"^ |
|
111 | p = r"^ [$>] (%s)" % p[1:] | |
110 | else: |
|
112 | else: | |
111 |
p = r"^ |
|
113 | p = r"^ [$>] .*(%s)" % p | |
112 | utestpats[i].append((p, m)) |
|
114 | utestpats[i].append((p, m)) | |
113 |
|
115 | |||
114 | utestfilters = [ |
|
116 | utestfilters = [ |
@@ -8,7 +8,11 b'' | |||||
8 | # This software may be used and distributed according to the terms of the |
|
8 | # This software may be used and distributed according to the terms of the | |
9 | # GNU General Public License version 2 or any later version. |
|
9 | # GNU General Public License version 2 or any later version. | |
10 |
|
10 | |||
11 |
'''command to display child changesets |
|
11 | '''command to display child changesets (DEPRECATED) | |
|
12 | ||||
|
13 | This extension is deprecated. You should use :hg:`log -r | |||
|
14 | "children(REV)"` instead. | |||
|
15 | ''' | |||
12 |
|
16 | |||
13 | from mercurial import cmdutil |
|
17 | from mercurial import cmdutil | |
14 | from mercurial.commands import templateopts |
|
18 | from mercurial.commands import templateopts |
@@ -5,7 +5,7 b'' | |||||
5 | # This software may be used and distributed according to the terms of the |
|
5 | # This software may be used and distributed according to the terms of the | |
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | '''pull, update and merge in one command''' |
|
8 | '''pull, update and merge in one command (DEPRECATED)''' | |
9 |
|
9 | |||
10 | from mercurial.i18n import _ |
|
10 | from mercurial.i18n import _ | |
11 | from mercurial.node import nullid, short |
|
11 | from mercurial.node import nullid, short |
@@ -301,7 +301,7 b' def disabledext(name):' | |||||
301 |
|
301 | |||
302 | def disabledcmd(ui, cmd, strict=False): |
|
302 | def disabledcmd(ui, cmd, strict=False): | |
303 | '''import disabled extensions until cmd is found. |
|
303 | '''import disabled extensions until cmd is found. | |
304 |
returns (cmdname, extname, |
|
304 | returns (cmdname, extname, module)''' | |
305 |
|
305 | |||
306 | paths = _disabledpaths(strip_init=True) |
|
306 | paths = _disabledpaths(strip_init=True) | |
307 | if not paths: |
|
307 | if not paths: | |
@@ -329,18 +329,19 b' def disabledcmd(ui, cmd, strict=False):' | |||||
329 | cmd = aliases[0] |
|
329 | cmd = aliases[0] | |
330 | return (cmd, name, mod) |
|
330 | return (cmd, name, mod) | |
331 |
|
331 | |||
|
332 | ext = None | |||
332 | # first, search for an extension with the same name as the command |
|
333 | # first, search for an extension with the same name as the command | |
333 | path = paths.pop(cmd, None) |
|
334 | path = paths.pop(cmd, None) | |
334 | if path: |
|
335 | if path: | |
335 | ext = findcmd(cmd, cmd, path) |
|
336 | ext = findcmd(cmd, cmd, path) | |
336 |
|
|
337 | if not ext: | |
337 | return ext |
|
338 | # otherwise, interrogate each extension until there's a match | |
338 |
|
339 | for name, path in paths.iteritems(): | ||
339 | # otherwise, interrogate each extension until there's a match |
|
340 | ext = findcmd(cmd, name, path) | |
340 | for name, path in paths.iteritems(): |
|
341 | if ext: | |
341 | ext = findcmd(cmd, name, path) |
|
342 | break | |
342 | if ext: |
|
343 | if ext and 'DEPRECATED' not in ext.__doc__: | |
343 |
|
|
344 | return ext | |
344 |
|
345 | |||
345 | raise error.UnknownCommand(cmd) |
|
346 | raise error.UnknownCommand(cmd) | |
346 |
|
347 |
@@ -610,12 +610,25 b'' | |||||
610 | tests/test-commandserver.py:0: |
|
610 | tests/test-commandserver.py:0: | |
611 | > print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***', data)) |
|
611 | > print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***', data)) | |
612 | warning: line over 80 characters |
|
612 | warning: line over 80 characters | |
|
613 | tests/test-convert-mtn.t:0: | |||
|
614 | > > function get_passphrase(keypair_id) | |||
|
615 | don't use 'function', use old style | |||
613 | tests/test-filecache.py:0: |
|
616 | tests/test-filecache.py:0: | |
614 | > except: |
|
617 | > except: | |
615 | warning: naked except clause |
|
618 | warning: naked except clause | |
616 | tests/test-filecache.py:0: |
|
619 | tests/test-filecache.py:0: | |
617 | > if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'], 'cacheable']): |
|
620 | > if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'], 'cacheable']): | |
618 | warning: line over 80 characters |
|
621 | warning: line over 80 characters | |
|
622 | tests/test-import-git.t:0: | |||
|
623 | > > Mc\${NkU|\`?^000jF3jhEB | |||
|
624 | ^ must be quoted | |||
|
625 | tests/test-import.t:0: | |||
|
626 | > > diff -Naur proj-orig/foo proj-new/foo | |||
|
627 | don't use 'diff -N' | |||
|
628 | don't use 'diff -N' | |||
|
629 | tests/test-schemes.t:0: | |||
|
630 | > > z = file:\$PWD/ | |||
|
631 | don't use $PWD, use `pwd` | |||
619 | tests/test-ui-color.py:0: |
|
632 | tests/test-ui-color.py:0: | |
620 | > testui.warn('warning\n') |
|
633 | > testui.warn('warning\n') | |
621 | warning: unwrapped ui message |
|
634 | warning: unwrapped ui message |
@@ -1,79 +1,163 b'' | |||||
1 | #!/bin/sh |
|
1 | $ "$TESTDIR/hghave" baz || exit 80 | |
|
2 | ||||
|
3 | $ baz my-id "mercurial <mercurial@selenic.com>" | |||
2 |
|
4 | |||
3 | "$TESTDIR/hghave" baz || exit 80 |
|
5 | $ echo "[extensions]" >> $HGRCPATH | |
4 |
|
6 | $ echo "convert=" >> $HGRCPATH | ||
5 | baz my-id "mercurial <mercurial@selenic.com>" |
|
7 | $ echo 'graphlog =' >> $HGRCPATH | |
6 |
|
8 | |||
7 | echo "[extensions]" >> $HGRCPATH |
|
9 | create baz archive | |
8 | echo "convert=" >> $HGRCPATH |
|
10 | $ baz make-archive baz@mercurial--convert hg-test-convert-baz | |
9 | echo 'graphlog =' >> $HGRCPATH |
|
|||
10 |
|
11 | |||
11 | echo % create baz archive |
|
12 | initialize baz repo | |
12 | baz make-archive baz@mercurial--convert hg-test-convert-baz |
|
13 | $ mkdir baz-repo | |
|
14 | $ cd baz-repo/ | |||
|
15 | $ baz init-tree baz@mercurial--convert/baz--test--0 | |||
|
16 | $ baz import | |||
|
17 | * creating version baz@mercurial--convert/baz--test--0 | |||
|
18 | * imported baz@mercurial--convert/baz--test--0 | |||
13 |
|
19 | |||
14 | echo % initialize baz repo |
|
20 | create initial files | |
15 | mkdir baz-repo |
|
21 | $ echo 'this is a file' > a | |
16 | cd baz-repo/ |
|
22 | $ baz add a | |
17 | baz init-tree baz@mercurial--convert/baz--test--0 |
|
23 | $ mkdir src | |
18 | baz import |
|
24 | $ baz add src | |
|
25 | $ cd src | |||
|
26 | $ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null | |||
|
27 | $ baz add b | |||
|
28 | HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead" | |||
|
29 | $ baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v '^tar' | |||
|
30 | * build pristine tree for baz@mercurial--convert/baz--test--0--base-0 | |||
|
31 | * Scanning for full-tree revision: . | |||
|
32 | * from import revision: baz@mercurial--convert/baz--test--0--base-0 | |||
|
33 | A/ .arch-ids | |||
|
34 | A/ src | |||
|
35 | A/ src/.arch-ids | |||
|
36 | A .arch-ids/a.id | |||
|
37 | A a | |||
|
38 | A src/.arch-ids/=id | |||
|
39 | A src/.arch-ids/b.id | |||
|
40 | A src/b | |||
|
41 | * update pristine tree (baz@mercurial--convert/baz--test--0--base-0 => baz--test--0--patch-1) | |||
|
42 | * committed baz@mercurial--convert/baz--test--0--patch-1 | |||
19 |
|
43 | |||
20 | echo % create initial files |
|
44 | create link file and modify a | |
21 | echo 'this is a file' > a |
|
45 | $ ln -s ../a a-link | |
22 | baz add a |
|
46 | $ baz add a-link | |
23 | mkdir src |
|
47 | $ echo 'this a modification to a' >> ../a | |
24 | baz add src |
|
48 | $ baz commit -s "added link to a and modify a" | |
25 | cd src |
|
49 | A src/.arch-ids/a-link.id | |
26 | dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
|
50 | A src/a-link | |
27 | baz add b |
|
51 | M a | |
28 | # HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead" |
|
52 | * update pristine tree (baz@mercurial--convert/baz--test--0--patch-1 => baz--test--0--patch-2) | |
29 | baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v '^tar' |
|
53 | * committed baz@mercurial--convert/baz--test--0--patch-2 | |
30 |
|
54 | |||
31 |
|
|
55 | create second link and modify b | |
32 | ln -s ../a a-link |
|
56 | $ ln -s ../a a-link-2 | |
33 | baz add a-link |
|
57 | $ baz add a-link-2 | |
34 | echo 'this a modification to a' >> ../a |
|
58 | $ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null | |
35 |
baz commit -s "added link |
|
59 | $ baz commit -s "added second link and modify b" | |
|
60 | A src/.arch-ids/a-link-2.id | |||
|
61 | A src/a-link-2 | |||
|
62 | Mb src/b | |||
|
63 | * update pristine tree (baz@mercurial--convert/baz--test--0--patch-2 => baz--test--0--patch-3) | |||
|
64 | * committed baz@mercurial--convert/baz--test--0--patch-3 | |||
|
65 | ||||
|
66 | b file to link and a-link-2 to regular file | |||
|
67 | $ rm -f a-link-2 | |||
|
68 | $ echo 'this is now a regular file' > a-link-2 | |||
|
69 | $ ln -sf ../a b | |||
|
70 | $ baz commit -s "file to link and link to file test" | |||
|
71 | fl src/b | |||
|
72 | lf src/a-link-2 | |||
|
73 | * update pristine tree (baz@mercurial--convert/baz--test--0--patch-3 => baz--test--0--patch-4) | |||
|
74 | * committed baz@mercurial--convert/baz--test--0--patch-4 | |||
36 |
|
75 | |||
37 | echo % create second link and modify b |
|
76 | move a-link-2 file and src directory | |
38 | ln -s ../a a-link-2 |
|
77 | $ cd .. | |
39 |
|
|
78 | $ baz mv src/a-link-2 c | |
40 | dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
|
79 | $ baz mv src test | |
41 | baz commit -s "added second link and modify b" |
|
80 | $ baz commit -s "move and rename a-link-2 file and src directory" | |
|
81 | D/ src/.arch-ids | |||
|
82 | A/ test/.arch-ids | |||
|
83 | /> src test | |||
|
84 | => src/.arch-ids/a-link-2.id .arch-ids/c.id | |||
|
85 | => src/a-link-2 c | |||
|
86 | => src/.arch-ids/=id test/.arch-ids/=id | |||
|
87 | => src/.arch-ids/a-link.id test/.arch-ids/a-link.id | |||
|
88 | => src/.arch-ids/b.id test/.arch-ids/b.id | |||
|
89 | * update pristine tree (baz@mercurial--convert/baz--test--0--patch-4 => baz--test--0--patch-5) | |||
|
90 | * committed baz@mercurial--convert/baz--test--0--patch-5 | |||
42 |
|
91 | |||
43 | echo % b file to link and a-link-2 to regular file |
|
92 | move and add the moved file again | |
44 | rm -f a-link-2 |
|
93 | $ echo e > e | |
45 | echo 'this is now a regular file' > a-link-2 |
|
94 | $ baz add e | |
46 | ln -sf ../a b |
|
95 | $ baz commit -s "add e" | |
47 | baz commit -s "file to link and link to file test" |
|
96 | A .arch-ids/e.id | |
48 |
|
97 | A e | ||
49 | echo % move a-link-2 file and src directory |
|
98 | * update pristine tree (baz@mercurial--convert/baz--test--0--patch-5 => baz--test--0--patch-6) | |
50 | cd .. |
|
99 | * committed baz@mercurial--convert/baz--test--0--patch-6 | |
51 | baz mv src/a-link-2 c |
|
100 | $ baz mv e f | |
52 | baz mv src test |
|
101 | $ echo ee > e | |
53 | baz commit -s "move and rename a-link-2 file and src directory" |
|
102 | $ baz add e | |
|
103 | $ baz commit -s "move e and recreate it again" | |||
|
104 | A .arch-ids/e.id | |||
|
105 | A e | |||
|
106 | => .arch-ids/e.id .arch-ids/f.id | |||
|
107 | => e f | |||
|
108 | * update pristine tree (baz@mercurial--convert/baz--test--0--patch-6 => baz--test--0--patch-7) | |||
|
109 | * committed baz@mercurial--convert/baz--test--0--patch-7 | |||
|
110 | $ cd .. | |||
54 |
|
111 | |||
55 | echo % move and add the moved file again |
|
112 | converting baz repo to Mercurial | |
56 | echo e > e |
|
113 | $ hg convert baz-repo baz-repo-hg | |
57 | baz add e |
|
114 | initializing destination baz-repo-hg repository | |
58 | baz commit -s "add e" |
|
115 | analyzing tree version baz@mercurial--convert/baz--test--0... | |
59 | baz mv e f |
|
116 | scanning source... | |
60 | echo ee > e |
|
117 | sorting... | |
61 | baz add e |
|
118 | converting... | |
62 | baz commit -s "move e and recreate it again" |
|
119 | 7 initial import | |
63 | cd .. |
|
120 | 6 added a file, src and src/b (binary) | |
|
121 | 5 added link to a and modify a | |||
|
122 | 4 added second link and modify b | |||
|
123 | 3 file to link and link to file test | |||
|
124 | 2 move and rename a-link-2 file and src directory | |||
|
125 | 1 add e | |||
|
126 | 0 move e and recreate it again | |||
64 |
|
127 | |||
65 | echo % converting baz repo to Mercurial |
|
128 | $ baz register-archive -d baz@mercurial--convert | |
66 | hg convert baz-repo baz-repo-hg |
|
129 | ||
|
130 | $ glog() | |||
|
131 | > { | |||
|
132 | > hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |||
|
133 | > } | |||
67 |
|
134 | |||
68 | baz register-archive -d baz@mercurial--convert |
|
135 | show graph log | |
69 |
|
136 | $ glog -R baz-repo-hg | ||
70 | glog() |
|
137 | o 7 "move e and recreate it again" files: e f | |
71 | { |
|
138 | | | |
72 | hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" |
|
139 | o 6 "add e" files: e | |
73 | } |
|
140 | | | |
74 |
|
141 | 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 | ||
75 | echo % show graph log |
|
142 | | | |
76 | glog -R baz-repo-hg |
|
143 | o 4 "file to link and link to file test" files: src/a-link-2 src/b | |
77 | hg up -q -R baz-repo-hg |
|
144 | | | |
78 | hg -R baz-repo-hg manifest --debug |
|
145 | o 3 "added second link and modify b" files: src/a-link-2 src/b | |
79 | hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies |
|
146 | | | |
|
147 | o 2 "added link to a and modify a" files: a src/a-link | |||
|
148 | | | |||
|
149 | o 1 "added a file, src and src/b (binary)" files: a src/b | |||
|
150 | | | |||
|
151 | o 0 "initial import" files: | |||
|
152 | ||||
|
153 | $ hg up -q -R baz-repo-hg | |||
|
154 | $ hg -R baz-repo-hg manifest --debug | |||
|
155 | c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a | |||
|
156 | 0201ac32a3a8e86e303dff60366382a54b48a72e 644 c | |||
|
157 | 1a4a864db0073705a11b1439f563bfa4b46d9246 644 e | |||
|
158 | 09e0222742fc3f75777fa9d68a5d8af7294cb5e7 644 f | |||
|
159 | c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link | |||
|
160 | 375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b | |||
|
161 | $ hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies | |||
|
162 | copies: c (src/a-link-2) test/a-link (src/a-link) test/b (src/b) | |||
|
163 | copies: f (e) |
This diff has been collapsed as it changes many lines, (817 lines changed) Show them Hide them | |||||
@@ -1,104 +1,733 b'' | |||||
1 | #!/bin/sh |
|
1 | $ "$TESTDIR/hghave" p4 execbit symlink || exit 80 | |
|
2 | ||||
|
3 | $ echo "[extensions]" >> $HGRCPATH | |||
|
4 | $ echo "convert = " >> $HGRCPATH | |||
|
5 | ||||
|
6 | create p4 depot | |||
|
7 | $ P4ROOT=`pwd`/depot; export P4ROOT | |||
|
8 | $ P4AUDIT=$P4ROOT/audit; export P4AUDIT | |||
|
9 | $ P4JOURNAL=$P4ROOT/journal; export P4JOURNAL | |||
|
10 | $ P4LOG=$P4ROOT/log; export P4LOG | |||
|
11 | $ P4PORT=localhost:16661; export P4PORT | |||
|
12 | $ P4DEBUG=1; export P4DEBUG | |||
|
13 | $ P4CHARSET=utf8; export P4CHARSET | |||
2 |
|
14 | |||
3 | "$TESTDIR/hghave" p4 execbit symlink || exit 80 |
|
15 | start the p4 server | |
|
16 | $ [ ! -d $P4ROOT ] && mkdir $P4ROOT | |||
|
17 | $ p4d -f -J off -xi >$P4ROOT/stdout 2>$P4ROOT/stderr | |||
|
18 | $ p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & | |||
|
19 | $ echo $! >> $DAEMON_PIDS | |||
|
20 | $ trap "echo stopping the p4 server ; p4 admin stop" EXIT | |||
4 |
|
21 | |||
5 | echo "[extensions]" >> $HGRCPATH |
|
22 | wait for the server to initialize | |
6 | echo "convert = " >> $HGRCPATH |
|
23 | $ while ! p4 ; do | |
|
24 | > sleep 1 | |||
|
25 | > done >/dev/null 2>/dev/null | |||
|
26 | ||||
|
27 | create a client spec | |||
|
28 | $ P4CLIENT=hg-p4-import; export P4CLIENT | |||
|
29 | $ DEPOTPATH=//depot/test-mercurial-import/... | |||
|
30 | $ p4 client -o | sed '/^View:/,$ d' >p4client | |||
|
31 | $ echo View: >>p4client | |||
|
32 | $ echo " $DEPOTPATH //$P4CLIENT/..." >>p4client | |||
|
33 | $ p4 client -i <p4client | |||
|
34 | Client hg-p4-import saved. | |||
7 |
|
35 | |||
8 | echo % create p4 depot |
|
36 | populate the depot | |
9 | P4ROOT=`pwd`/depot; export P4ROOT |
|
37 | $ TYPES="text binary symlink" | |
10 | P4AUDIT=$P4ROOT/audit; export P4AUDIT |
|
38 | $ 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" | |
11 | P4JOURNAL=$P4ROOT/journal; export P4JOURNAL |
|
39 | $ TYPES="$TYPES binary+k binary+x binary+kx symlink+k" | |
12 | P4LOG=$P4ROOT/log; export P4LOG |
|
40 | $ TYPES="$TYPES ctext cxtext ktext kxtext ltext tempobj ubinary uxbinary xbinary xltext xtempobj xtext" | |
13 | P4PORT=localhost:16661; export P4PORT |
|
41 | not testing these | |
14 | P4DEBUG=1; export P4DEBUG |
|
42 | $ #TYPES="$TYPES apple resource unicode utf16 uresource xunicode xutf16" | |
15 | P4CHARSET=utf8; export P4CHARSET |
|
43 | $ for T in $TYPES ; do | |
|
44 | > T2=`echo $T | tr [:upper:] [:lower:]` | |||
|
45 | > case $T in | |||
|
46 | > apple) | |||
|
47 | > ;; | |||
|
48 | > symlink*) | |||
|
49 | > echo "this is target $T" >target_$T2 | |||
|
50 | > ln -s target_$T file_$T2 | |||
|
51 | > p4 add target_$T2 | |||
|
52 | > p4 add -t $T file_$T2 | |||
|
53 | > ;; | |||
|
54 | > binary*) | |||
|
55 | > python -c "file('file_$T2', 'wb').write('this is $T')" | |||
|
56 | > p4 add -t $T file_$T2 | |||
|
57 | > ;; | |||
|
58 | > *) | |||
|
59 | > echo "this is $T" >file_$T2 | |||
|
60 | > p4 add -t $T file_$T2 | |||
|
61 | > ;; | |||
|
62 | > esac | |||
|
63 | > done | |||
|
64 | //depot/test-mercurial-import/file_text#1 - opened for add | |||
|
65 | //depot/test-mercurial-import/file_binary#1 - opened for add | |||
|
66 | //depot/test-mercurial-import/target_symlink#1 - opened for add | |||
|
67 | //depot/test-mercurial-import/file_symlink#1 - opened for add | |||
|
68 | //depot/test-mercurial-import/file_text+m#1 - opened for add | |||
|
69 | //depot/test-mercurial-import/file_text+w#1 - opened for add | |||
|
70 | //depot/test-mercurial-import/file_text+x#1 - opened for add | |||
|
71 | //depot/test-mercurial-import/file_text+k#1 - opened for add | |||
|
72 | //depot/test-mercurial-import/file_text+kx#1 - opened for add | |||
|
73 | //depot/test-mercurial-import/file_text+ko#1 - opened for add | |||
|
74 | //depot/test-mercurial-import/file_text+l#1 - opened for add | |||
|
75 | //depot/test-mercurial-import/file_text+c#1 - opened for add | |||
|
76 | //depot/test-mercurial-import/file_text+d#1 - opened for add | |||
|
77 | //depot/test-mercurial-import/file_text+f#1 - opened for add | |||
|
78 | //depot/test-mercurial-import/file_text+s#1 - opened for add | |||
|
79 | //depot/test-mercurial-import/file_text+s2#1 - opened for add | |||
|
80 | //depot/test-mercurial-import/file_binary+k#1 - opened for add | |||
|
81 | //depot/test-mercurial-import/file_binary+x#1 - opened for add | |||
|
82 | //depot/test-mercurial-import/file_binary+kx#1 - opened for add | |||
|
83 | //depot/test-mercurial-import/target_symlink+k#1 - opened for add | |||
|
84 | //depot/test-mercurial-import/file_symlink+k#1 - opened for add | |||
|
85 | //depot/test-mercurial-import/file_ctext#1 - opened for add | |||
|
86 | //depot/test-mercurial-import/file_cxtext#1 - opened for add | |||
|
87 | //depot/test-mercurial-import/file_ktext#1 - opened for add | |||
|
88 | //depot/test-mercurial-import/file_kxtext#1 - opened for add | |||
|
89 | //depot/test-mercurial-import/file_ltext#1 - opened for add | |||
|
90 | //depot/test-mercurial-import/file_tempobj#1 - opened for add | |||
|
91 | //depot/test-mercurial-import/file_ubinary#1 - opened for add | |||
|
92 | //depot/test-mercurial-import/file_uxbinary#1 - opened for add | |||
|
93 | //depot/test-mercurial-import/file_xbinary#1 - opened for add | |||
|
94 | //depot/test-mercurial-import/file_xltext#1 - opened for add | |||
|
95 | //depot/test-mercurial-import/file_xtempobj#1 - opened for add | |||
|
96 | //depot/test-mercurial-import/file_xtext#1 - opened for add | |||
|
97 | $ p4 submit -d initial | |||
|
98 | Submitting change 1. | |||
|
99 | Locking 33 files ... | |||
|
100 | add //depot/test-mercurial-import/file_binary#1 | |||
|
101 | add //depot/test-mercurial-import/file_binary+k#1 | |||
|
102 | add //depot/test-mercurial-import/file_binary+kx#1 | |||
|
103 | add //depot/test-mercurial-import/file_binary+x#1 | |||
|
104 | add //depot/test-mercurial-import/file_ctext#1 | |||
|
105 | add //depot/test-mercurial-import/file_cxtext#1 | |||
|
106 | add //depot/test-mercurial-import/file_ktext#1 | |||
|
107 | add //depot/test-mercurial-import/file_kxtext#1 | |||
|
108 | add //depot/test-mercurial-import/file_ltext#1 | |||
|
109 | add //depot/test-mercurial-import/file_symlink#1 | |||
|
110 | add //depot/test-mercurial-import/file_symlink+k#1 | |||
|
111 | add //depot/test-mercurial-import/file_tempobj#1 | |||
|
112 | add //depot/test-mercurial-import/file_text#1 | |||
|
113 | add //depot/test-mercurial-import/file_text+c#1 | |||
|
114 | add //depot/test-mercurial-import/file_text+d#1 | |||
|
115 | add //depot/test-mercurial-import/file_text+f#1 | |||
|
116 | add //depot/test-mercurial-import/file_text+k#1 | |||
|
117 | add //depot/test-mercurial-import/file_text+ko#1 | |||
|
118 | add //depot/test-mercurial-import/file_text+kx#1 | |||
|
119 | add //depot/test-mercurial-import/file_text+l#1 | |||
|
120 | add //depot/test-mercurial-import/file_text+m#1 | |||
|
121 | add //depot/test-mercurial-import/file_text+s#1 | |||
|
122 | add //depot/test-mercurial-import/file_text+s2#1 | |||
|
123 | add //depot/test-mercurial-import/file_text+w#1 | |||
|
124 | add //depot/test-mercurial-import/file_text+x#1 | |||
|
125 | add //depot/test-mercurial-import/file_ubinary#1 | |||
|
126 | add //depot/test-mercurial-import/file_uxbinary#1 | |||
|
127 | add //depot/test-mercurial-import/file_xbinary#1 | |||
|
128 | add //depot/test-mercurial-import/file_xltext#1 | |||
|
129 | add //depot/test-mercurial-import/file_xtempobj#1 | |||
|
130 | add //depot/test-mercurial-import/file_xtext#1 | |||
|
131 | add //depot/test-mercurial-import/target_symlink#1 | |||
|
132 | add //depot/test-mercurial-import/target_symlink+k#1 | |||
|
133 | Change 1 submitted. | |||
|
134 | //depot/test-mercurial-import/file_binary+k#1 - refreshing | |||
|
135 | //depot/test-mercurial-import/file_binary+kx#1 - refreshing | |||
|
136 | //depot/test-mercurial-import/file_ktext#1 - refreshing | |||
|
137 | //depot/test-mercurial-import/file_kxtext#1 - refreshing | |||
|
138 | //depot/test-mercurial-import/file_symlink+k#1 - refreshing | |||
|
139 | //depot/test-mercurial-import/file_text+k#1 - refreshing | |||
|
140 | //depot/test-mercurial-import/file_text+ko#1 - refreshing | |||
|
141 | //depot/test-mercurial-import/file_text+kx#1 - refreshing | |||
16 |
|
142 | |||
17 | echo % start the p4 server |
|
143 | test keyword expansion | |
18 | [ ! -d $P4ROOT ] && mkdir $P4ROOT |
|
144 | $ p4 edit file_* target_* | |
19 | p4d -f -J off -xi >$P4ROOT/stdout 2>$P4ROOT/stderr |
|
145 | //depot/test-mercurial-import/file_binary#1 - opened for edit | |
20 | p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & |
|
146 | //depot/test-mercurial-import/file_binary+k#1 - opened for edit | |
21 | trap "echo % stop the p4 server ; p4 admin stop" EXIT |
|
147 | //depot/test-mercurial-import/file_binary+kx#1 - opened for edit | |
|
148 | //depot/test-mercurial-import/file_binary+x#1 - opened for edit | |||
|
149 | //depot/test-mercurial-import/file_ctext#1 - opened for edit | |||
|
150 | //depot/test-mercurial-import/file_cxtext#1 - opened for edit | |||
|
151 | //depot/test-mercurial-import/file_ktext#1 - opened for edit | |||
|
152 | //depot/test-mercurial-import/file_kxtext#1 - opened for edit | |||
|
153 | //depot/test-mercurial-import/file_ltext#1 - opened for edit | |||
|
154 | //depot/test-mercurial-import/file_symlink#1 - opened for edit | |||
|
155 | //depot/test-mercurial-import/file_symlink+k#1 - opened for edit | |||
|
156 | //depot/test-mercurial-import/file_tempobj#1 - opened for edit | |||
|
157 | //depot/test-mercurial-import/file_text#1 - opened for edit | |||
|
158 | //depot/test-mercurial-import/file_text+c#1 - opened for edit | |||
|
159 | //depot/test-mercurial-import/file_text+d#1 - opened for edit | |||
|
160 | //depot/test-mercurial-import/file_text+f#1 - opened for edit | |||
|
161 | //depot/test-mercurial-import/file_text+k#1 - opened for edit | |||
|
162 | //depot/test-mercurial-import/file_text+ko#1 - opened for edit | |||
|
163 | //depot/test-mercurial-import/file_text+kx#1 - opened for edit | |||
|
164 | //depot/test-mercurial-import/file_text+l#1 - opened for edit | |||
|
165 | //depot/test-mercurial-import/file_text+m#1 - opened for edit | |||
|
166 | //depot/test-mercurial-import/file_text+s#1 - opened for edit | |||
|
167 | //depot/test-mercurial-import/file_text+s2#1 - opened for edit | |||
|
168 | //depot/test-mercurial-import/file_text+w#1 - opened for edit | |||
|
169 | //depot/test-mercurial-import/file_text+x#1 - opened for edit | |||
|
170 | //depot/test-mercurial-import/file_ubinary#1 - opened for edit | |||
|
171 | //depot/test-mercurial-import/file_uxbinary#1 - opened for edit | |||
|
172 | //depot/test-mercurial-import/file_xbinary#1 - opened for edit | |||
|
173 | //depot/test-mercurial-import/file_xltext#1 - opened for edit | |||
|
174 | //depot/test-mercurial-import/file_xtempobj#1 - opened for edit | |||
|
175 | //depot/test-mercurial-import/file_xtext#1 - opened for edit | |||
|
176 | //depot/test-mercurial-import/target_symlink#1 - opened for edit | |||
|
177 | //depot/test-mercurial-import/target_symlink+k#1 - opened for edit | |||
|
178 | $ for T in $TYPES ; do | |||
|
179 | > T2=`echo $T | tr [:upper:] [:lower:]` | |||
|
180 | > echo '$Id$' >>file_$T2 | |||
|
181 | > echo '$Header$' >>file_$T2 | |||
|
182 | > echo '$Date$' >>file_$T2 | |||
|
183 | > echo '$DateTime$' >>file_$T2 | |||
|
184 | > echo '$Change$' >>file_$T2 | |||
|
185 | > echo '$File$' >>file_$T2 | |||
|
186 | > echo '$Revision$' >>file_$T2 | |||
|
187 | > echo '$Header$$Header$Header$' >>file_$T2 | |||
|
188 | > done | |||
|
189 | ||||
|
190 | $ ln -s 'target_$Header$' crazy_symlink+k | |||
|
191 | $ p4 add -t symlink+k crazy_symlink+k | |||
|
192 | //depot/test-mercurial-import/crazy_symlink+k#1 - opened for add | |||
22 |
|
193 | |||
23 | # wait for the server to initialize |
|
194 | $ p4 submit -d keywords | |
24 | while ! p4 ; do |
|
195 | Submitting change 2. | |
25 | sleep 1 |
|
196 | Locking 34 files ... | |
26 | done >/dev/null 2>/dev/null |
|
197 | add //depot/test-mercurial-import/crazy_symlink+k#1 | |
|
198 | edit //depot/test-mercurial-import/file_binary#2 | |||
|
199 | edit //depot/test-mercurial-import/file_binary+k#2 | |||
|
200 | edit //depot/test-mercurial-import/file_binary+kx#2 | |||
|
201 | edit //depot/test-mercurial-import/file_binary+x#2 | |||
|
202 | edit //depot/test-mercurial-import/file_ctext#2 | |||
|
203 | edit //depot/test-mercurial-import/file_cxtext#2 | |||
|
204 | edit //depot/test-mercurial-import/file_ktext#2 | |||
|
205 | edit //depot/test-mercurial-import/file_kxtext#2 | |||
|
206 | edit //depot/test-mercurial-import/file_ltext#2 | |||
|
207 | edit //depot/test-mercurial-import/file_symlink#2 | |||
|
208 | edit //depot/test-mercurial-import/file_symlink+k#2 | |||
|
209 | edit //depot/test-mercurial-import/file_tempobj#2 | |||
|
210 | edit //depot/test-mercurial-import/file_text#2 | |||
|
211 | edit //depot/test-mercurial-import/file_text+c#2 | |||
|
212 | edit //depot/test-mercurial-import/file_text+d#2 | |||
|
213 | edit //depot/test-mercurial-import/file_text+f#2 | |||
|
214 | edit //depot/test-mercurial-import/file_text+k#2 | |||
|
215 | edit //depot/test-mercurial-import/file_text+ko#2 | |||
|
216 | edit //depot/test-mercurial-import/file_text+kx#2 | |||
|
217 | edit //depot/test-mercurial-import/file_text+l#2 | |||
|
218 | edit //depot/test-mercurial-import/file_text+m#2 | |||
|
219 | edit //depot/test-mercurial-import/file_text+s#2 | |||
|
220 | edit //depot/test-mercurial-import/file_text+s2#2 | |||
|
221 | edit //depot/test-mercurial-import/file_text+w#2 | |||
|
222 | edit //depot/test-mercurial-import/file_text+x#2 | |||
|
223 | edit //depot/test-mercurial-import/file_ubinary#2 | |||
|
224 | edit //depot/test-mercurial-import/file_uxbinary#2 | |||
|
225 | edit //depot/test-mercurial-import/file_xbinary#2 | |||
|
226 | edit //depot/test-mercurial-import/file_xltext#2 | |||
|
227 | edit //depot/test-mercurial-import/file_xtempobj#2 | |||
|
228 | edit //depot/test-mercurial-import/file_xtext#2 | |||
|
229 | edit //depot/test-mercurial-import/target_symlink#2 | |||
|
230 | edit //depot/test-mercurial-import/target_symlink+k#2 | |||
|
231 | Change 2 submitted. | |||
|
232 | //depot/test-mercurial-import/crazy_symlink+k#1 - refreshing | |||
|
233 | //depot/test-mercurial-import/file_binary+k#2 - refreshing | |||
|
234 | //depot/test-mercurial-import/file_binary+kx#2 - refreshing | |||
|
235 | //depot/test-mercurial-import/file_ktext#2 - refreshing | |||
|
236 | //depot/test-mercurial-import/file_kxtext#2 - refreshing | |||
|
237 | //depot/test-mercurial-import/file_symlink+k#2 - refreshing | |||
|
238 | //depot/test-mercurial-import/file_text+k#2 - refreshing | |||
|
239 | //depot/test-mercurial-import/file_text+ko#2 - refreshing | |||
|
240 | //depot/test-mercurial-import/file_text+kx#2 - refreshing | |||
27 |
|
241 | |||
28 | echo % create a client spec |
|
242 | check keywords in p4 | |
29 | P4CLIENT=hg-p4-import; export P4CLIENT |
|
243 | $ grep -H Header file_* | |
30 | DEPOTPATH=//depot/test-mercurial-import/... |
|
244 | file_binary:$Header$ | |
31 | p4 client -o | sed '/^View:/,$ d' >p4client |
|
245 | file_binary:$Header$$Header$Header$ | |
32 | echo View: >>p4client |
|
246 | file_binary+k:$Header: //depot/test-mercurial-import/file_binary+k#2 $ | |
33 | echo " $DEPOTPATH //$P4CLIENT/..." >>p4client |
|
247 | file_binary+k:$Header: //depot/test-mercurial-import/file_binary+k#2 $$Header: //depot/test-mercurial-import/file_binary+k#2 $Header$ | |
34 | p4 client -i <p4client |
|
248 | file_binary+kx:$Header: //depot/test-mercurial-import/file_binary+kx#2 $ | |
|
249 | file_binary+kx:$Header: //depot/test-mercurial-import/file_binary+kx#2 $$Header: //depot/test-mercurial-import/file_binary+kx#2 $Header$ | |||
|
250 | file_binary+x:$Header$ | |||
|
251 | file_binary+x:$Header$$Header$Header$ | |||
|
252 | file_ctext:$Header$ | |||
|
253 | file_ctext:$Header$$Header$Header$ | |||
|
254 | file_cxtext:$Header$ | |||
|
255 | file_cxtext:$Header$$Header$Header$ | |||
|
256 | file_ktext:$Header: //depot/test-mercurial-import/file_ktext#2 $ | |||
|
257 | file_ktext:$Header: //depot/test-mercurial-import/file_ktext#2 $$Header: //depot/test-mercurial-import/file_ktext#2 $Header$ | |||
|
258 | file_kxtext:$Header: //depot/test-mercurial-import/file_kxtext#2 $ | |||
|
259 | file_kxtext:$Header: //depot/test-mercurial-import/file_kxtext#2 $$Header: //depot/test-mercurial-import/file_kxtext#2 $Header$ | |||
|
260 | file_ltext:$Header$ | |||
|
261 | file_ltext:$Header$$Header$Header$ | |||
|
262 | file_symlink:$Header$ | |||
|
263 | file_symlink:$Header$$Header$Header$ | |||
|
264 | file_symlink+k:$Header$ | |||
|
265 | file_symlink+k:$Header$$Header$Header$ | |||
|
266 | file_tempobj:$Header$ | |||
|
267 | file_tempobj:$Header$$Header$Header$ | |||
|
268 | file_text:$Header$ | |||
|
269 | file_text:$Header$$Header$Header$ | |||
|
270 | file_text+c:$Header$ | |||
|
271 | file_text+c:$Header$$Header$Header$ | |||
|
272 | file_text+d:$Header$ | |||
|
273 | file_text+d:$Header$$Header$Header$ | |||
|
274 | file_text+f:$Header$ | |||
|
275 | file_text+f:$Header$$Header$Header$ | |||
|
276 | file_text+k:$Header: //depot/test-mercurial-import/file_text+k#2 $ | |||
|
277 | file_text+k:$Header: //depot/test-mercurial-import/file_text+k#2 $$Header: //depot/test-mercurial-import/file_text+k#2 $Header$ | |||
|
278 | file_text+ko:$Header: //depot/test-mercurial-import/file_text+ko#2 $ | |||
|
279 | file_text+ko:$Header: //depot/test-mercurial-import/file_text+ko#2 $$Header: //depot/test-mercurial-import/file_text+ko#2 $Header$ | |||
|
280 | file_text+kx:$Header: //depot/test-mercurial-import/file_text+kx#2 $ | |||
|
281 | file_text+kx:$Header: //depot/test-mercurial-import/file_text+kx#2 $$Header: //depot/test-mercurial-import/file_text+kx#2 $Header$ | |||
|
282 | file_text+l:$Header$ | |||
|
283 | file_text+l:$Header$$Header$Header$ | |||
|
284 | file_text+m:$Header$ | |||
|
285 | file_text+m:$Header$$Header$Header$ | |||
|
286 | file_text+s:$Header$ | |||
|
287 | file_text+s:$Header$$Header$Header$ | |||
|
288 | file_text+s2:$Header$ | |||
|
289 | file_text+s2:$Header$$Header$Header$ | |||
|
290 | file_text+w:$Header$ | |||
|
291 | file_text+w:$Header$$Header$Header$ | |||
|
292 | file_text+x:$Header$ | |||
|
293 | file_text+x:$Header$$Header$Header$ | |||
|
294 | file_ubinary:$Header$ | |||
|
295 | file_ubinary:$Header$$Header$Header$ | |||
|
296 | file_uxbinary:$Header$ | |||
|
297 | file_uxbinary:$Header$$Header$Header$ | |||
|
298 | file_xbinary:$Header$ | |||
|
299 | file_xbinary:$Header$$Header$Header$ | |||
|
300 | file_xltext:$Header$ | |||
|
301 | file_xltext:$Header$$Header$Header$ | |||
|
302 | file_xtempobj:$Header$ | |||
|
303 | file_xtempobj:$Header$$Header$Header$ | |||
|
304 | file_xtext:$Header$ | |||
|
305 | file_xtext:$Header$$Header$Header$ | |||
|
306 | ||||
|
307 | convert | |||
|
308 | $ hg convert -s p4 $DEPOTPATH dst | |||
|
309 | initializing destination dst repository | |||
|
310 | reading p4 views | |||
|
311 | collecting p4 changelists | |||
|
312 | 1 initial | |||
|
313 | 2 keywords | |||
|
314 | scanning source... | |||
|
315 | sorting... | |||
|
316 | converting... | |||
|
317 | 1 initial | |||
|
318 | 0 keywords | |||
|
319 | $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |||
|
320 | 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" | |||
|
321 | 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" | |||
35 |
|
322 | |||
36 | echo % populate the depot |
|
323 | revision 0 | |
37 | TYPES="text binary symlink" |
|
324 | $ hg -R dst update 0 | |
38 | 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" |
|
325 | 30 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
39 | TYPES="$TYPES binary+k binary+x binary+kx symlink+k" |
|
326 | $ head dst/file_* | cat -v | |
40 | TYPES="$TYPES ctext cxtext ktext kxtext ltext tempobj ubinary uxbinary xbinary xltext xtempobj xtext" |
|
327 | ==> dst/file_binary <== | |
41 | # not testing these |
|
328 | this is binary | |
42 | #TYPES="$TYPES apple resource unicode utf16 uresource xunicode xutf16" |
|
329 | ==> dst/file_binary+k <== | |
43 | for T in $TYPES ; do |
|
330 | this is binary+k | |
44 | T2=`echo $T | tr [:upper:] [:lower:]` |
|
331 | ==> dst/file_binary+kx <== | |
45 | case $T in |
|
332 | this is binary+kx | |
46 | apple) |
|
333 | ==> dst/file_binary+x <== | |
47 | ;; |
|
334 | this is binary+x | |
48 | symlink*) |
|
335 | ==> dst/file_ctext <== | |
49 | echo "this is target $T" >target_$T2 |
|
336 | this is ctext | |
50 | ln -s target_$T file_$T2 |
|
337 | ||
51 | p4 add target_$T2 |
|
338 | ==> dst/file_cxtext <== | |
52 | p4 add -t $T file_$T2 |
|
339 | this is cxtext | |
53 | ;; |
|
340 | ||
54 | binary*) |
|
341 | ==> dst/file_ktext <== | |
55 | python -c "file('file_$T2', 'wb').write('this is $T')" |
|
342 | this is ktext | |
56 | p4 add -t $T file_$T2 |
|
343 | ||
57 | ;; |
|
344 | ==> dst/file_kxtext <== | |
58 | *) |
|
345 | this is kxtext | |
59 | echo "this is $T" >file_$T2 |
|
346 | ||
60 | p4 add -t $T file_$T2 |
|
347 | ==> dst/file_ltext <== | |
61 | ;; |
|
348 | this is ltext | |
62 | esac |
|
349 | ||
63 | done |
|
350 | ==> dst/file_symlink <== | |
64 | p4 submit -d initial |
|
351 | this is target symlink | |
|
352 | ||||
|
353 | ==> dst/file_symlink+k <== | |||
|
354 | this is target symlink+k | |||
|
355 | ||||
|
356 | ==> dst/file_text <== | |||
|
357 | this is text | |||
|
358 | ||||
|
359 | ==> dst/file_text+c <== | |||
|
360 | this is text+C | |||
|
361 | ||||
|
362 | ==> dst/file_text+d <== | |||
|
363 | this is text+D | |||
|
364 | ||||
|
365 | ==> dst/file_text+f <== | |||
|
366 | this is text+F | |||
|
367 | ||||
|
368 | ==> dst/file_text+k <== | |||
|
369 | this is text+k | |||
|
370 | ||||
|
371 | ==> dst/file_text+ko <== | |||
|
372 | this is text+ko | |||
|
373 | ||||
|
374 | ==> dst/file_text+kx <== | |||
|
375 | this is text+kx | |||
|
376 | ||||
|
377 | ==> dst/file_text+l <== | |||
|
378 | this is text+l | |||
|
379 | ||||
|
380 | ==> dst/file_text+m <== | |||
|
381 | this is text+m | |||
|
382 | ||||
|
383 | ==> dst/file_text+s2 <== | |||
|
384 | this is text+S2 | |||
|
385 | ||||
|
386 | ==> dst/file_text+w <== | |||
|
387 | this is text+w | |||
|
388 | ||||
|
389 | ==> dst/file_text+x <== | |||
|
390 | this is text+x | |||
|
391 | ||||
|
392 | ==> dst/file_ubinary <== | |||
|
393 | this is ubinary | |||
|
394 | ||||
|
395 | ==> dst/file_uxbinary <== | |||
|
396 | this is uxbinary | |||
|
397 | ||||
|
398 | ==> dst/file_xbinary <== | |||
|
399 | this is xbinary | |||
|
400 | ||||
|
401 | ==> dst/file_xltext <== | |||
|
402 | this is xltext | |||
|
403 | ||||
|
404 | ==> dst/file_xtext <== | |||
|
405 | this is xtext | |||
65 |
|
406 | |||
66 | echo % test keyword expansion |
|
407 | revision 1 | |
67 | p4 edit file_* target_* |
|
408 | $ hg -R dst update 1 | |
68 | for T in $TYPES ; do |
|
409 | 30 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
69 | T2=`echo $T | tr [:upper:] [:lower:]` |
|
410 | $ head dst/file_* | cat -v | |
70 | echo '$Id$' >>file_$T2 |
|
411 | ==> dst/file_binary <== | |
71 | echo '$Header$' >>file_$T2 |
|
412 | this is binary$Id$ | |
72 | echo '$Date$' >>file_$T2 |
|
413 | $Header$ | |
73 | echo '$DateTime$' >>file_$T2 |
|
414 | $Date$ | |
74 | echo '$Change$' >>file_$T2 |
|
415 | $DateTime$ | |
75 | echo '$File$' >>file_$T2 |
|
416 | $Change$ | |
76 | echo '$Revision$' >>file_$T2 |
|
417 | $File$ | |
77 | echo '$Header$$Header$Header$' >>file_$T2 |
|
418 | $Revision$ | |
78 | done |
|
419 | $Header$$Header$Header$ | |
79 |
|
420 | |||
80 | ln -s 'target_$Header$' crazy_symlink+k |
|
421 | ==> dst/file_binary+k <== | |
81 | p4 add -t symlink+k crazy_symlink+k |
|
422 | this is binary+k$Id$ | |
82 |
|
423 | $Header$ | ||
83 | p4 submit -d keywords |
|
424 | $Date$ | |
|
425 | $DateTime$ | |||
|
426 | $Change$ | |||
|
427 | $File$ | |||
|
428 | $Revision$ | |||
|
429 | $Header$$Header$Header$ | |||
|
430 | ||||
|
431 | ==> dst/file_binary+kx <== | |||
|
432 | this is binary+kx$Id$ | |||
|
433 | $Header$ | |||
|
434 | $Date$ | |||
|
435 | $DateTime$ | |||
|
436 | $Change$ | |||
|
437 | $File$ | |||
|
438 | $Revision$ | |||
|
439 | $Header$$Header$Header$ | |||
|
440 | ||||
|
441 | ==> dst/file_binary+x <== | |||
|
442 | this is binary+x$Id$ | |||
|
443 | $Header$ | |||
|
444 | $Date$ | |||
|
445 | $DateTime$ | |||
|
446 | $Change$ | |||
|
447 | $File$ | |||
|
448 | $Revision$ | |||
|
449 | $Header$$Header$Header$ | |||
|
450 | ||||
|
451 | ==> dst/file_ctext <== | |||
|
452 | this is ctext | |||
|
453 | $Id$ | |||
|
454 | $Header$ | |||
|
455 | $Date$ | |||
|
456 | $DateTime$ | |||
|
457 | $Change$ | |||
|
458 | $File$ | |||
|
459 | $Revision$ | |||
|
460 | $Header$$Header$Header$ | |||
|
461 | ||||
|
462 | ==> dst/file_cxtext <== | |||
|
463 | this is cxtext | |||
|
464 | $Id$ | |||
|
465 | $Header$ | |||
|
466 | $Date$ | |||
|
467 | $DateTime$ | |||
|
468 | $Change$ | |||
|
469 | $File$ | |||
|
470 | $Revision$ | |||
|
471 | $Header$$Header$Header$ | |||
|
472 | ||||
|
473 | ==> dst/file_ktext <== | |||
|
474 | this is ktext | |||
|
475 | $Id$ | |||
|
476 | $Header$ | |||
|
477 | $Date$ | |||
|
478 | $DateTime$ | |||
|
479 | $Change$ | |||
|
480 | $File$ | |||
|
481 | $Revision$ | |||
|
482 | $Header$$Header$Header$ | |||
|
483 | ||||
|
484 | ==> dst/file_kxtext <== | |||
|
485 | this is kxtext | |||
|
486 | $Id$ | |||
|
487 | $Header$ | |||
|
488 | $Date$ | |||
|
489 | $DateTime$ | |||
|
490 | $Change$ | |||
|
491 | $File$ | |||
|
492 | $Revision$ | |||
|
493 | $Header$$Header$Header$ | |||
|
494 | ||||
|
495 | ==> dst/file_ltext <== | |||
|
496 | this is ltext | |||
|
497 | $Id$ | |||
|
498 | $Header$ | |||
|
499 | $Date$ | |||
|
500 | $DateTime$ | |||
|
501 | $Change$ | |||
|
502 | $File$ | |||
|
503 | $Revision$ | |||
|
504 | $Header$$Header$Header$ | |||
|
505 | ||||
|
506 | ==> dst/file_symlink <== | |||
|
507 | this is target symlink | |||
|
508 | $Id$ | |||
|
509 | $Header$ | |||
|
510 | $Date$ | |||
|
511 | $DateTime$ | |||
|
512 | $Change$ | |||
|
513 | $File$ | |||
|
514 | $Revision$ | |||
|
515 | $Header$$Header$Header$ | |||
|
516 | ||||
|
517 | ==> dst/file_symlink+k <== | |||
|
518 | this is target symlink+k | |||
|
519 | $Id$ | |||
|
520 | $Header$ | |||
|
521 | $Date$ | |||
|
522 | $DateTime$ | |||
|
523 | $Change$ | |||
|
524 | $File$ | |||
|
525 | $Revision$ | |||
|
526 | $Header$$Header$Header$ | |||
|
527 | ||||
|
528 | ==> dst/file_text <== | |||
|
529 | this is text | |||
|
530 | $Id$ | |||
|
531 | $Header$ | |||
|
532 | $Date$ | |||
|
533 | $DateTime$ | |||
|
534 | $Change$ | |||
|
535 | $File$ | |||
|
536 | $Revision$ | |||
|
537 | $Header$$Header$Header$ | |||
|
538 | ||||
|
539 | ==> dst/file_text+c <== | |||
|
540 | this is text+C | |||
|
541 | $Id$ | |||
|
542 | $Header$ | |||
|
543 | $Date$ | |||
|
544 | $DateTime$ | |||
|
545 | $Change$ | |||
|
546 | $File$ | |||
|
547 | $Revision$ | |||
|
548 | $Header$$Header$Header$ | |||
|
549 | ||||
|
550 | ==> dst/file_text+d <== | |||
|
551 | this is text+D | |||
|
552 | $Id$ | |||
|
553 | $Header$ | |||
|
554 | $Date$ | |||
|
555 | $DateTime$ | |||
|
556 | $Change$ | |||
|
557 | $File$ | |||
|
558 | $Revision$ | |||
|
559 | $Header$$Header$Header$ | |||
|
560 | ||||
|
561 | ==> dst/file_text+f <== | |||
|
562 | this is text+F | |||
|
563 | $Id$ | |||
|
564 | $Header$ | |||
|
565 | $Date$ | |||
|
566 | $DateTime$ | |||
|
567 | $Change$ | |||
|
568 | $File$ | |||
|
569 | $Revision$ | |||
|
570 | $Header$$Header$Header$ | |||
|
571 | ||||
|
572 | ==> dst/file_text+k <== | |||
|
573 | this is text+k | |||
|
574 | $Id$ | |||
|
575 | $Header$ | |||
|
576 | $Date$ | |||
|
577 | $DateTime$ | |||
|
578 | $Change$ | |||
|
579 | $File$ | |||
|
580 | $Revision$ | |||
|
581 | $Header$$Header$Header$ | |||
|
582 | ||||
|
583 | ==> dst/file_text+ko <== | |||
|
584 | this is text+ko | |||
|
585 | $Id$ | |||
|
586 | $Header$ | |||
|
587 | $Date$ | |||
|
588 | $DateTime$ | |||
|
589 | $Change$ | |||
|
590 | $File$ | |||
|
591 | $Revision$ | |||
|
592 | $Header$$Header$Header$ | |||
|
593 | ||||
|
594 | ==> dst/file_text+kx <== | |||
|
595 | this is text+kx | |||
|
596 | $Id$ | |||
|
597 | $Header$ | |||
|
598 | $Date$ | |||
|
599 | $DateTime$ | |||
|
600 | $Change$ | |||
|
601 | $File$ | |||
|
602 | $Revision$ | |||
|
603 | $Header$$Header$Header$ | |||
|
604 | ||||
|
605 | ==> dst/file_text+l <== | |||
|
606 | this is text+l | |||
|
607 | $Id$ | |||
|
608 | $Header$ | |||
|
609 | $Date$ | |||
|
610 | $DateTime$ | |||
|
611 | $Change$ | |||
|
612 | $File$ | |||
|
613 | $Revision$ | |||
|
614 | $Header$$Header$Header$ | |||
|
615 | ||||
|
616 | ==> dst/file_text+m <== | |||
|
617 | this is text+m | |||
|
618 | $Id$ | |||
|
619 | $Header$ | |||
|
620 | $Date$ | |||
|
621 | $DateTime$ | |||
|
622 | $Change$ | |||
|
623 | $File$ | |||
|
624 | $Revision$ | |||
|
625 | $Header$$Header$Header$ | |||
|
626 | ||||
|
627 | ==> dst/file_text+s <== | |||
|
628 | this is text+S | |||
|
629 | $Id$ | |||
|
630 | $Header$ | |||
|
631 | $Date$ | |||
|
632 | $DateTime$ | |||
|
633 | $Change$ | |||
|
634 | $File$ | |||
|
635 | $Revision$ | |||
|
636 | $Header$$Header$Header$ | |||
|
637 | ||||
|
638 | ==> dst/file_text+s2 <== | |||
|
639 | this is text+S2 | |||
|
640 | $Id$ | |||
|
641 | $Header$ | |||
|
642 | $Date$ | |||
|
643 | $DateTime$ | |||
|
644 | $Change$ | |||
|
645 | $File$ | |||
|
646 | $Revision$ | |||
|
647 | $Header$$Header$Header$ | |||
|
648 | ||||
|
649 | ==> dst/file_text+w <== | |||
|
650 | this is text+w | |||
|
651 | $Id$ | |||
|
652 | $Header$ | |||
|
653 | $Date$ | |||
|
654 | $DateTime$ | |||
|
655 | $Change$ | |||
|
656 | $File$ | |||
|
657 | $Revision$ | |||
|
658 | $Header$$Header$Header$ | |||
|
659 | ||||
|
660 | ==> dst/file_text+x <== | |||
|
661 | this is text+x | |||
|
662 | $Id$ | |||
|
663 | $Header$ | |||
|
664 | $Date$ | |||
|
665 | $DateTime$ | |||
|
666 | $Change$ | |||
|
667 | $File$ | |||
|
668 | $Revision$ | |||
|
669 | $Header$$Header$Header$ | |||
|
670 | ||||
|
671 | ==> dst/file_ubinary <== | |||
|
672 | this is ubinary | |||
|
673 | $Id$ | |||
|
674 | $Header$ | |||
|
675 | $Date$ | |||
|
676 | $DateTime$ | |||
|
677 | $Change$ | |||
|
678 | $File$ | |||
|
679 | $Revision$ | |||
|
680 | $Header$$Header$Header$ | |||
|
681 | ||||
|
682 | ==> dst/file_uxbinary <== | |||
|
683 | this is uxbinary | |||
|
684 | $Id$ | |||
|
685 | $Header$ | |||
|
686 | $Date$ | |||
|
687 | $DateTime$ | |||
|
688 | $Change$ | |||
|
689 | $File$ | |||
|
690 | $Revision$ | |||
|
691 | $Header$$Header$Header$ | |||
|
692 | ||||
|
693 | ==> dst/file_xbinary <== | |||
|
694 | this is xbinary | |||
|
695 | $Id$ | |||
|
696 | $Header$ | |||
|
697 | $Date$ | |||
|
698 | $DateTime$ | |||
|
699 | $Change$ | |||
|
700 | $File$ | |||
|
701 | $Revision$ | |||
|
702 | $Header$$Header$Header$ | |||
|
703 | ||||
|
704 | ==> dst/file_xltext <== | |||
|
705 | this is xltext | |||
|
706 | $Id$ | |||
|
707 | $Header$ | |||
|
708 | $Date$ | |||
|
709 | $DateTime$ | |||
|
710 | $Change$ | |||
|
711 | $File$ | |||
|
712 | $Revision$ | |||
|
713 | $Header$$Header$Header$ | |||
|
714 | ||||
|
715 | ==> dst/file_xtext <== | |||
|
716 | this is xtext | |||
|
717 | $Id$ | |||
|
718 | $Header$ | |||
|
719 | $Date$ | |||
|
720 | $DateTime$ | |||
|
721 | $Change$ | |||
|
722 | $File$ | |||
|
723 | $Revision$ | |||
|
724 | $Header$$Header$Header$ | |||
84 |
|
725 | |||
85 | echo % check keywords in p4 |
|
726 | crazy_symlink | |
86 | grep -H Header file_* |
|
727 | $ readlink crazy_symlink+k | |
87 |
|
728 | target_$Header: //depot/test-mercurial-import/crazy_symlink+k#1 $ | ||
88 | echo % convert |
|
729 | $ readlink dst/crazy_symlink+k | |
89 | hg convert -s p4 $DEPOTPATH dst |
|
730 | target_$Header$ | |
90 | hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'g |
|
|||
91 |
|
731 | |||
92 | echo % revision 0 |
|
732 | exit trap: | |
93 | hg -R dst update 0 |
|
733 | stopping the p4 server | |
94 | head dst/file_* | cat -v |
|
|||
95 |
|
||||
96 | echo |
|
|||
97 | echo % revision 1 |
|
|||
98 | hg -R dst update 1 |
|
|||
99 | head dst/file_* | cat -v |
|
|||
100 | echo |
|
|||
101 | echo % crazy_symlink |
|
|||
102 | readlink crazy_symlink+k |
|
|||
103 | readlink dst/crazy_symlink+k |
|
|||
104 |
|
@@ -1,75 +1,152 b'' | |||||
1 | #!/bin/sh |
|
1 | $ "$TESTDIR/hghave" p4 || exit 80 | |
|
2 | ||||
|
3 | $ echo "[extensions]" >> $HGRCPATH | |||
|
4 | $ echo "convert = " >> $HGRCPATH | |||
2 |
|
5 | |||
3 | "$TESTDIR/hghave" p4 || exit 80 |
|
6 | create p4 depot | |
4 |
|
7 | $ P4ROOT=`pwd`/depot; export P4ROOT | ||
5 | echo "[extensions]" >> $HGRCPATH |
|
8 | $ P4AUDIT=$P4ROOT/audit; export P4AUDIT | |
6 | echo "convert = " >> $HGRCPATH |
|
9 | $ P4JOURNAL=$P4ROOT/journal; export P4JOURNAL | |
|
10 | $ P4LOG=$P4ROOT/log; export P4LOG | |||
|
11 | $ P4PORT=localhost:16661; export P4PORT | |||
|
12 | $ P4DEBUG=1; export P4DEBUG | |||
7 |
|
13 | |||
8 | echo % create p4 depot |
|
14 | start the p4 server | |
9 | P4ROOT=`pwd`/depot; export P4ROOT |
|
15 | $ [ ! -d $P4ROOT ] && mkdir $P4ROOT | |
10 | P4AUDIT=$P4ROOT/audit; export P4AUDIT |
|
16 | $ p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & | |
11 | P4JOURNAL=$P4ROOT/journal; export P4JOURNAL |
|
17 | $ echo $! >> $DAEMON_PIDS | |
12 | P4LOG=$P4ROOT/log; export P4LOG |
|
18 | $ trap "echo stopping the p4 server ; p4 admin stop" EXIT | |
13 | P4PORT=localhost:16661; export P4PORT |
|
19 | ||
14 | P4DEBUG=1; export P4DEBUG |
|
20 | $ # wait for the server to initialize | |
|
21 | $ while ! p4 ; do | |||
|
22 | > sleep 1 | |||
|
23 | > done >/dev/null 2>/dev/null | |||
|
24 | ||||
|
25 | create a client spec | |||
|
26 | $ P4CLIENT=hg-p4-import; export P4CLIENT | |||
|
27 | $ DEPOTPATH=//depot/test-mercurial-import/... | |||
|
28 | $ p4 client -o | sed '/^View:/,$ d' >p4client | |||
|
29 | $ echo View: >>p4client | |||
|
30 | $ echo " $DEPOTPATH //$P4CLIENT/..." >>p4client | |||
|
31 | $ p4 client -i <p4client | |||
|
32 | Client hg-p4-import saved. | |||
15 |
|
33 | |||
16 | echo % start the p4 server |
|
34 | populate the depot | |
17 | [ ! -d $P4ROOT ] && mkdir $P4ROOT |
|
35 | $ echo a > a | |
18 | p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & |
|
36 | $ mkdir b | |
19 | trap "echo % stop the p4 server ; p4 admin stop" EXIT |
|
37 | $ echo c > b/c | |
|
38 | $ p4 add a b/c | |||
|
39 | //depot/test-mercurial-import/a#1 - opened for add | |||
|
40 | //depot/test-mercurial-import/b/c#1 - opened for add | |||
|
41 | $ p4 submit -d initial | |||
|
42 | Submitting change 1. | |||
|
43 | Locking 2 files ... | |||
|
44 | add //depot/test-mercurial-import/a#1 | |||
|
45 | add //depot/test-mercurial-import/b/c#1 | |||
|
46 | Change 1 submitted. | |||
20 |
|
47 | |||
21 | # wait for the server to initialize |
|
48 | change some files | |
22 | while ! p4 ; do |
|
49 | $ p4 edit a | |
23 | sleep 1 |
|
50 | //depot/test-mercurial-import/a#1 - opened for edit | |
24 | done >/dev/null 2>/dev/null |
|
51 | $ echo aa >> a | |
|
52 | $ p4 submit -d "change a" | |||
|
53 | Submitting change 2. | |||
|
54 | Locking 1 files ... | |||
|
55 | edit //depot/test-mercurial-import/a#2 | |||
|
56 | Change 2 submitted. | |||
25 |
|
57 | |||
26 | echo % create a client spec |
|
58 | $ p4 edit b/c | |
27 | P4CLIENT=hg-p4-import; export P4CLIENT |
|
59 | //depot/test-mercurial-import/b/c#1 - opened for edit | |
28 | DEPOTPATH=//depot/test-mercurial-import/... |
|
60 | $ echo cc >> b/c | |
29 | p4 client -o | sed '/^View:/,$ d' >p4client |
|
61 | $ p4 submit -d "change b/c" | |
30 | echo View: >>p4client |
|
62 | Submitting change 3. | |
31 | echo " $DEPOTPATH //$P4CLIENT/..." >>p4client |
|
63 | Locking 1 files ... | |
32 | p4 client -i <p4client |
|
64 | edit //depot/test-mercurial-import/b/c#2 | |
|
65 | Change 3 submitted. | |||
33 |
|
66 | |||
34 | echo % populate the depot |
|
67 | convert | |
35 | echo a > a |
|
68 | $ hg convert -s p4 $DEPOTPATH dst | |
36 | mkdir b |
|
69 | initializing destination dst repository | |
37 | echo c > b/c |
|
70 | reading p4 views | |
38 | p4 add a b/c |
|
71 | collecting p4 changelists | |
39 |
|
|
72 | 1 initial | |
|
73 | 2 change a | |||
|
74 | 3 change b/c | |||
|
75 | scanning source... | |||
|
76 | sorting... | |||
|
77 | converting... | |||
|
78 | 2 initial | |||
|
79 | 1 change a | |||
|
80 | 0 change b/c | |||
|
81 | $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |||
|
82 | rev=2 desc="change b/c" tags="tip" files="b/c" | |||
|
83 | rev=1 desc="change a" tags="" files="a" | |||
|
84 | rev=0 desc="initial" tags="" files="a b/c" | |||
40 |
|
85 | |||
41 |
|
|
86 | change some files | |
42 | p4 edit a |
|
87 | $ p4 edit a b/c | |
43 | echo aa >> a |
|
88 | //depot/test-mercurial-import/a#2 - opened for edit | |
44 | p4 submit -d "change a" |
|
89 | //depot/test-mercurial-import/b/c#2 - opened for edit | |
45 |
|
90 | $ echo aaa >> a | ||
46 | p4 edit b/c |
|
91 | $ echo ccc >> b/c | |
47 | echo cc >> b/c |
|
92 | $ p4 submit -d "change a b/c" | |
48 | p4 submit -d "change b/c" |
|
93 | Submitting change 4. | |
49 |
|
94 | Locking 2 files ... | ||
50 | echo % convert |
|
95 | edit //depot/test-mercurial-import/a#3 | |
51 | hg convert -s p4 $DEPOTPATH dst |
|
96 | edit //depot/test-mercurial-import/b/c#3 | |
52 | hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' |
|
97 | Change 4 submitted. | |
53 |
|
98 | |||
54 | echo % change some files |
|
99 | convert again | |
55 | p4 edit a b/c |
|
100 | $ hg convert -s p4 $DEPOTPATH dst | |
56 | echo aaa >> a |
|
101 | reading p4 views | |
57 | echo ccc >> b/c |
|
102 | collecting p4 changelists | |
58 | p4 submit -d "change a b/c" |
|
103 | 1 initial | |
59 |
|
104 | 2 change a | ||
60 | echo % convert again |
|
105 | 3 change b/c | |
61 | hg convert -s p4 $DEPOTPATH dst |
|
106 | 4 change a b/c | |
62 | hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' |
|
107 | scanning source... | |
|
108 | sorting... | |||
|
109 | converting... | |||
|
110 | 0 change a b/c | |||
|
111 | $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |||
|
112 | rev=3 desc="change a b/c" tags="tip" files="a b/c" | |||
|
113 | rev=2 desc="change b/c" tags="" files="b/c" | |||
|
114 | rev=1 desc="change a" tags="" files="a" | |||
|
115 | rev=0 desc="initial" tags="" files="a b/c" | |||
63 |
|
116 | |||
64 |
|
|
117 | interesting names | |
65 | echo dddd > "d d" |
|
118 | $ echo dddd > "d d" | |
66 | mkdir " e" |
|
119 | $ mkdir " e" | |
67 | echo fff >" e/ f" |
|
120 | $ echo fff >" e/ f" | |
68 | p4 add "d d" " e/ f" |
|
121 | $ p4 add "d d" " e/ f" | |
69 | p4 submit -d "add d e f" |
|
122 | //depot/test-mercurial-import/d d#1 - opened for add | |
|
123 | //depot/test-mercurial-import/ e/ f#1 - opened for add | |||
|
124 | $ p4 submit -d "add d e f" | |||
|
125 | Submitting change 5. | |||
|
126 | Locking 2 files ... | |||
|
127 | add //depot/test-mercurial-import/ e/ f#1 | |||
|
128 | add //depot/test-mercurial-import/d d#1 | |||
|
129 | Change 5 submitted. | |||
70 |
|
130 | |||
71 |
|
|
131 | convert again | |
72 | hg convert -s p4 $DEPOTPATH dst |
|
132 | $ hg convert -s p4 $DEPOTPATH dst | |
73 | hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' |
|
133 | reading p4 views | |
|
134 | collecting p4 changelists | |||
|
135 | 1 initial | |||
|
136 | 2 change a | |||
|
137 | 3 change b/c | |||
|
138 | 4 change a b/c | |||
|
139 | 5 add d e f | |||
|
140 | scanning source... | |||
|
141 | sorting... | |||
|
142 | converting... | |||
|
143 | 0 add d e f | |||
|
144 | $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' | |||
|
145 | rev=4 desc="add d e f" tags="tip" files=" e/ f d d" | |||
|
146 | rev=3 desc="change a b/c" tags="" files="a b/c" | |||
|
147 | rev=2 desc="change b/c" tags="" files="b/c" | |||
|
148 | rev=1 desc="change a" tags="" files="a" | |||
|
149 | rev=0 desc="initial" tags="" files="a b/c" | |||
74 |
|
150 | |||
75 |
|
151 | exit trap: | ||
|
152 | stopping the p4 server |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (642 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now