Show More
@@ -1,225 +1,229 b'' | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | """Test the running system for features availability. Exit with zero |
|
2 | """Test the running system for features availability. Exit with zero | |
3 | if all features are there, non-zero otherwise. If a feature name is |
|
3 | if all features are there, non-zero otherwise. If a feature name is | |
4 | prefixed with "no-", the absence of feature is tested. |
|
4 | prefixed with "no-", the absence of feature is tested. | |
5 | """ |
|
5 | """ | |
6 | import optparse |
|
6 | import optparse | |
7 | import os |
|
7 | import os | |
8 | import re |
|
8 | import re | |
9 | import sys |
|
9 | import sys | |
10 | import tempfile |
|
10 | import tempfile | |
11 |
|
11 | |||
12 | tempprefix = 'hg-hghave-' |
|
12 | tempprefix = 'hg-hghave-' | |
13 |
|
13 | |||
14 | def matchoutput(cmd, regexp, ignorestatus=False): |
|
14 | def matchoutput(cmd, regexp, ignorestatus=False): | |
15 | """Return True if cmd executes successfully and its output |
|
15 | """Return True if cmd executes successfully and its output | |
16 | is matched by the supplied regular expression. |
|
16 | is matched by the supplied regular expression. | |
17 | """ |
|
17 | """ | |
18 | r = re.compile(regexp) |
|
18 | r = re.compile(regexp) | |
19 | fh = os.popen(cmd) |
|
19 | fh = os.popen(cmd) | |
20 | s = fh.read() |
|
20 | s = fh.read() | |
21 | ret = fh.close() |
|
21 | ret = fh.close() | |
22 | return (ignorestatus or ret is None) and r.search(s) |
|
22 | return (ignorestatus or ret is None) and r.search(s) | |
23 |
|
23 | |||
24 | def has_baz(): |
|
24 | def has_baz(): | |
25 | return matchoutput('baz --version 2>&1', r'baz Bazaar version') |
|
25 | return matchoutput('baz --version 2>&1', r'baz Bazaar version') | |
26 |
|
26 | |||
27 | def has_bzr(): |
|
27 | def has_bzr(): | |
28 | try: |
|
28 | try: | |
29 | import bzrlib |
|
29 | import bzrlib | |
30 | return True |
|
30 | return True | |
31 | except ImportError: |
|
31 | except ImportError: | |
32 | return False |
|
32 | return False | |
33 |
|
33 | |||
34 | def has_cvs(): |
|
34 | def has_cvs(): | |
35 | re = r'Concurrent Versions System.*?server' |
|
35 | re = r'Concurrent Versions System.*?server' | |
36 | return matchoutput('cvs --version 2>&1', re) |
|
36 | return matchoutput('cvs --version 2>&1', re) | |
37 |
|
37 | |||
38 | def has_cvsps(): |
|
38 | def has_cvsps(): | |
39 | return matchoutput('cvsps -h -q 2>&1', r'cvsps version', True) |
|
39 | return matchoutput('cvsps -h -q 2>&1', r'cvsps version', True) | |
40 |
|
40 | |||
41 | def has_darcs(): |
|
41 | def has_darcs(): | |
42 | return matchoutput('darcs', r'darcs version', True) |
|
42 | return matchoutput('darcs', r'darcs version', True) | |
43 |
|
43 | |||
44 | def has_mtn(): |
|
44 | def has_mtn(): | |
45 | return matchoutput('mtn --version', r'monotone', True) and not matchoutput( |
|
45 | return matchoutput('mtn --version', r'monotone', True) and not matchoutput( | |
46 | 'mtn --version', r'monotone 0\.(\d|[12]\d|3[01])[^\d]', True) |
|
46 | 'mtn --version', r'monotone 0\.(\d|[12]\d|3[01])[^\d]', True) | |
47 |
|
47 | |||
48 | def has_eol_in_paths(): |
|
48 | def has_eol_in_paths(): | |
49 | try: |
|
49 | try: | |
50 | fd, path = tempfile.mkstemp(prefix=tempprefix, suffix='\n\r') |
|
50 | fd, path = tempfile.mkstemp(prefix=tempprefix, suffix='\n\r') | |
51 | os.close(fd) |
|
51 | os.close(fd) | |
52 | os.remove(path) |
|
52 | os.remove(path) | |
53 | return True |
|
53 | return True | |
54 | except: |
|
54 | except: | |
55 | return False |
|
55 | return False | |
56 |
|
56 | |||
57 | def has_executablebit(): |
|
57 | def has_executablebit(): | |
58 | fd, path = tempfile.mkstemp(prefix=tempprefix) |
|
58 | fd, path = tempfile.mkstemp(prefix=tempprefix) | |
59 | os.close(fd) |
|
59 | os.close(fd) | |
60 | try: |
|
60 | try: | |
61 | s = os.lstat(path).st_mode |
|
61 | s = os.lstat(path).st_mode | |
62 | os.chmod(path, s | 0100) |
|
62 | os.chmod(path, s | 0100) | |
63 | return (os.lstat(path).st_mode & 0100 != 0) |
|
63 | return (os.lstat(path).st_mode & 0100 != 0) | |
64 | finally: |
|
64 | finally: | |
65 | os.remove(path) |
|
65 | os.remove(path) | |
66 |
|
66 | |||
67 | def has_icasefs(): |
|
67 | def has_icasefs(): | |
68 | # Stolen from mercurial.util |
|
68 | # Stolen from mercurial.util | |
69 | fd, path = tempfile.mkstemp(prefix=tempprefix) |
|
69 | fd, path = tempfile.mkstemp(prefix=tempprefix) | |
70 | os.close(fd) |
|
70 | os.close(fd) | |
71 | try: |
|
71 | try: | |
72 | s1 = os.stat(path) |
|
72 | s1 = os.stat(path) | |
73 | d, b = os.path.split(path) |
|
73 | d, b = os.path.split(path) | |
74 | p2 = os.path.join(d, b.upper()) |
|
74 | p2 = os.path.join(d, b.upper()) | |
75 | if path == p2: |
|
75 | if path == p2: | |
76 | p2 = os.path.join(d, b.lower()) |
|
76 | p2 = os.path.join(d, b.lower()) | |
77 | try: |
|
77 | try: | |
78 | s2 = os.stat(p2) |
|
78 | s2 = os.stat(p2) | |
79 | return s2 == s1 |
|
79 | return s2 == s1 | |
80 | except: |
|
80 | except: | |
81 | return False |
|
81 | return False | |
82 | finally: |
|
82 | finally: | |
83 | os.remove(path) |
|
83 | os.remove(path) | |
84 |
|
84 | |||
85 | def has_inotify(): |
|
85 | def has_inotify(): | |
86 | try: |
|
86 | try: | |
87 | import hgext.inotify.linux.watcher |
|
87 | import hgext.inotify.linux.watcher | |
88 | return True |
|
88 | return True | |
89 | except ImportError: |
|
89 | except ImportError: | |
90 | return False |
|
90 | return False | |
91 |
|
91 | |||
92 | def has_fifo(): |
|
92 | def has_fifo(): | |
93 | return hasattr(os, "mkfifo") |
|
93 | return hasattr(os, "mkfifo") | |
94 |
|
94 | |||
95 | def has_hotshot(): |
|
95 | def has_hotshot(): | |
96 | try: |
|
96 | try: | |
97 | # hotshot.stats tests hotshot and many problematic dependencies |
|
97 | # hotshot.stats tests hotshot and many problematic dependencies | |
98 | # like profile. |
|
98 | # like profile. | |
99 | import hotshot.stats |
|
99 | import hotshot.stats | |
100 | return True |
|
100 | return True | |
101 | except ImportError: |
|
101 | except ImportError: | |
102 | return False |
|
102 | return False | |
103 |
|
103 | |||
104 | def has_lsprof(): |
|
104 | def has_lsprof(): | |
105 | try: |
|
105 | try: | |
106 | import _lsprof |
|
106 | import _lsprof | |
107 | return True |
|
107 | return True | |
108 | except ImportError: |
|
108 | except ImportError: | |
109 | return False |
|
109 | return False | |
110 |
|
110 | |||
111 | def has_git(): |
|
111 | def has_git(): | |
112 | return matchoutput('git --version 2>&1', r'^git version') |
|
112 | return matchoutput('git --version 2>&1', r'^git version') | |
113 |
|
113 | |||
114 | def has_svn(): |
|
114 | def has_svn(): | |
115 | return matchoutput('svn --version 2>&1', r'^svn, version') and \ |
|
115 | return matchoutput('svn --version 2>&1', r'^svn, version') and \ | |
116 | matchoutput('svnadmin --version 2>&1', r'^svnadmin, version') |
|
116 | matchoutput('svnadmin --version 2>&1', r'^svnadmin, version') | |
117 |
|
117 | |||
118 | def has_svn_bindings(): |
|
118 | def has_svn_bindings(): | |
119 | try: |
|
119 | try: | |
120 | import svn.core |
|
120 | import svn.core | |
121 | version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR |
|
121 | version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR | |
122 | if version < (1, 4): |
|
122 | if version < (1, 4): | |
123 | return False |
|
123 | return False | |
124 | return True |
|
124 | return True | |
125 | except ImportError: |
|
125 | except ImportError: | |
126 | return False |
|
126 | return False | |
127 |
|
127 | |||
128 | def has_symlink(): |
|
128 | def has_symlink(): | |
129 | return hasattr(os, "symlink") |
|
129 | return hasattr(os, "symlink") | |
130 |
|
130 | |||
131 | def has_tla(): |
|
131 | def has_tla(): | |
132 | return matchoutput('tla --version 2>&1', r'The GNU Arch Revision') |
|
132 | return matchoutput('tla --version 2>&1', r'The GNU Arch Revision') | |
133 |
|
133 | |||
134 | def has_unix_permissions(): |
|
134 | def has_unix_permissions(): | |
135 | d = tempfile.mkdtemp(prefix=tempprefix, dir=".") |
|
135 | d = tempfile.mkdtemp(prefix=tempprefix, dir=".") | |
136 | try: |
|
136 | try: | |
137 | fname = os.path.join(d, 'foo') |
|
137 | fname = os.path.join(d, 'foo') | |
138 | for umask in (077, 007, 022): |
|
138 | for umask in (077, 007, 022): | |
139 | os.umask(umask) |
|
139 | os.umask(umask) | |
140 | f = open(fname, 'w') |
|
140 | f = open(fname, 'w') | |
141 | f.close() |
|
141 | f.close() | |
142 | mode = os.stat(fname).st_mode |
|
142 | mode = os.stat(fname).st_mode | |
143 | os.unlink(fname) |
|
143 | os.unlink(fname) | |
144 | if mode & 0777 != ~umask & 0666: |
|
144 | if mode & 0777 != ~umask & 0666: | |
145 | return False |
|
145 | return False | |
146 | return True |
|
146 | return True | |
147 | finally: |
|
147 | finally: | |
148 | os.rmdir(d) |
|
148 | os.rmdir(d) | |
149 |
|
149 | |||
150 | def has_pygments(): |
|
150 | def has_pygments(): | |
151 | try: |
|
151 | try: | |
152 | import pygments |
|
152 | import pygments | |
153 | return True |
|
153 | return True | |
154 | except ImportError: |
|
154 | except ImportError: | |
155 | return False |
|
155 | return False | |
156 |
|
156 | |||
|
157 | def has_outer_repo(): | |||
|
158 | return matchoutput('hg root 2>&1', r'') | |||
|
159 | ||||
157 | checks = { |
|
160 | checks = { | |
158 | "baz": (has_baz, "GNU Arch baz client"), |
|
161 | "baz": (has_baz, "GNU Arch baz client"), | |
159 | "bzr": (has_bzr, "Canonical's Bazaar client"), |
|
162 | "bzr": (has_bzr, "Canonical's Bazaar client"), | |
160 | "cvs": (has_cvs, "cvs client/server"), |
|
163 | "cvs": (has_cvs, "cvs client/server"), | |
161 | "cvsps": (has_cvsps, "cvsps utility"), |
|
164 | "cvsps": (has_cvsps, "cvsps utility"), | |
162 | "darcs": (has_darcs, "darcs client"), |
|
165 | "darcs": (has_darcs, "darcs client"), | |
163 | "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"), |
|
166 | "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"), | |
164 | "execbit": (has_executablebit, "executable bit"), |
|
167 | "execbit": (has_executablebit, "executable bit"), | |
165 | "fifo": (has_fifo, "named pipes"), |
|
168 | "fifo": (has_fifo, "named pipes"), | |
166 | "git": (has_git, "git command line client"), |
|
169 | "git": (has_git, "git command line client"), | |
167 | "hotshot": (has_hotshot, "python hotshot module"), |
|
170 | "hotshot": (has_hotshot, "python hotshot module"), | |
168 | "icasefs": (has_icasefs, "case insensitive file system"), |
|
171 | "icasefs": (has_icasefs, "case insensitive file system"), | |
169 | "inotify": (has_inotify, "inotify extension support"), |
|
172 | "inotify": (has_inotify, "inotify extension support"), | |
170 | "lsprof": (has_lsprof, "python lsprof module"), |
|
173 | "lsprof": (has_lsprof, "python lsprof module"), | |
171 | "mtn": (has_mtn, "monotone client (> 0.31)"), |
|
174 | "mtn": (has_mtn, "monotone client (> 0.31)"), | |
|
175 | "outer-repo": (has_outer_repo, "outer repo"), | |||
172 | "pygments": (has_pygments, "Pygments source highlighting library"), |
|
176 | "pygments": (has_pygments, "Pygments source highlighting library"), | |
173 | "svn": (has_svn, "subversion client and admin tools"), |
|
177 | "svn": (has_svn, "subversion client and admin tools"), | |
174 | "svn-bindings": (has_svn_bindings, "subversion python bindings"), |
|
178 | "svn-bindings": (has_svn_bindings, "subversion python bindings"), | |
175 | "symlink": (has_symlink, "symbolic links"), |
|
179 | "symlink": (has_symlink, "symbolic links"), | |
176 | "tla": (has_tla, "GNU Arch tla client"), |
|
180 | "tla": (has_tla, "GNU Arch tla client"), | |
177 | "unix-permissions": (has_unix_permissions, "unix-style permissions"), |
|
181 | "unix-permissions": (has_unix_permissions, "unix-style permissions"), | |
178 | } |
|
182 | } | |
179 |
|
183 | |||
180 | def list_features(): |
|
184 | def list_features(): | |
181 | for name, feature in checks.iteritems(): |
|
185 | for name, feature in checks.iteritems(): | |
182 | desc = feature[1] |
|
186 | desc = feature[1] | |
183 | print name + ':', desc |
|
187 | print name + ':', desc | |
184 |
|
188 | |||
185 | parser = optparse.OptionParser("%prog [options] [features]") |
|
189 | parser = optparse.OptionParser("%prog [options] [features]") | |
186 | parser.add_option("--list-features", action="store_true", |
|
190 | parser.add_option("--list-features", action="store_true", | |
187 | help="list available features") |
|
191 | help="list available features") | |
188 | parser.add_option("-q", "--quiet", action="store_true", |
|
192 | parser.add_option("-q", "--quiet", action="store_true", | |
189 | help="check features silently") |
|
193 | help="check features silently") | |
190 |
|
194 | |||
191 | if __name__ == '__main__': |
|
195 | if __name__ == '__main__': | |
192 | options, args = parser.parse_args() |
|
196 | options, args = parser.parse_args() | |
193 | if options.list_features: |
|
197 | if options.list_features: | |
194 | list_features() |
|
198 | list_features() | |
195 | sys.exit(0) |
|
199 | sys.exit(0) | |
196 |
|
200 | |||
197 | quiet = options.quiet |
|
201 | quiet = options.quiet | |
198 |
|
202 | |||
199 | failures = 0 |
|
203 | failures = 0 | |
200 |
|
204 | |||
201 | def error(msg): |
|
205 | def error(msg): | |
202 | global failures |
|
206 | global failures | |
203 | if not quiet: |
|
207 | if not quiet: | |
204 | sys.stderr.write(msg + '\n') |
|
208 | sys.stderr.write(msg + '\n') | |
205 | failures += 1 |
|
209 | failures += 1 | |
206 |
|
210 | |||
207 | for feature in args: |
|
211 | for feature in args: | |
208 | negate = feature.startswith('no-') |
|
212 | negate = feature.startswith('no-') | |
209 | if negate: |
|
213 | if negate: | |
210 | feature = feature[3:] |
|
214 | feature = feature[3:] | |
211 |
|
215 | |||
212 | if feature not in checks: |
|
216 | if feature not in checks: | |
213 | error('skipped: unknown feature: ' + feature) |
|
217 | error('skipped: unknown feature: ' + feature) | |
214 | continue |
|
218 | continue | |
215 |
|
219 | |||
216 | check, desc = checks[feature] |
|
220 | check, desc = checks[feature] | |
217 | if not negate and not check(): |
|
221 | if not negate and not check(): | |
218 | error('skipped: missing feature: ' + desc) |
|
222 | error('skipped: missing feature: ' + desc) | |
219 | elif negate and check(): |
|
223 | elif negate and check(): | |
220 | error('skipped: system supports %s' % desc) |
|
224 | error('skipped: system supports %s' % desc) | |
221 |
|
225 | |||
222 | if failures != 0: |
|
226 | if failures != 0: | |
223 | sys.exit(1) |
|
227 | sys.exit(1) | |
224 |
|
228 | |||
225 |
|
229 |
@@ -1,136 +1,136 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | "$TESTDIR/hghave" svn svn-bindings || exit 80 |
|
3 | "$TESTDIR/hghave" svn svn-bindings no-outer-repo || exit 80 | |
4 |
|
4 | |||
5 | fixpath() |
|
5 | fixpath() | |
6 | { |
|
6 | { | |
7 | tr '\\' / |
|
7 | tr '\\' / | |
8 | } |
|
8 | } | |
9 |
|
9 | |||
10 | svnupanddisplay() |
|
10 | svnupanddisplay() | |
11 | { |
|
11 | { | |
12 | ( |
|
12 | ( | |
13 | cd $1; |
|
13 | cd $1; | |
14 | svn up; |
|
14 | svn up; | |
15 | svn st -v | fixpath |
|
15 | svn st -v | fixpath | |
16 | limit='' |
|
16 | limit='' | |
17 | if [ $2 -gt 0 ]; then |
|
17 | if [ $2 -gt 0 ]; then | |
18 | limit="--limit=$2" |
|
18 | limit="--limit=$2" | |
19 | fi |
|
19 | fi | |
20 | svn log --xml -v $limit | fixpath | sed 's,<date>.*,<date/>,' |
|
20 | svn log --xml -v $limit | fixpath | sed 's,<date>.*,<date/>,' | |
21 | ) |
|
21 | ) | |
22 | } |
|
22 | } | |
23 |
|
23 | |||
24 | echo "[extensions]" >> $HGRCPATH |
|
24 | echo "[extensions]" >> $HGRCPATH | |
25 | echo "convert = " >> $HGRCPATH |
|
25 | echo "convert = " >> $HGRCPATH | |
26 |
|
26 | |||
27 | hg init a |
|
27 | hg init a | |
28 |
|
28 | |||
29 | echo a > a/a |
|
29 | echo a > a/a | |
30 | mkdir -p a/d1/d2 |
|
30 | mkdir -p a/d1/d2 | |
31 | echo b > a/d1/d2/b |
|
31 | echo b > a/d1/d2/b | |
32 | echo % add |
|
32 | echo % add | |
33 | hg --cwd a ci -d '0 0' -A -m 'add a file' |
|
33 | hg --cwd a ci -d '0 0' -A -m 'add a file' | |
34 |
|
34 | |||
35 | "$TESTDIR/svn-safe-append.py" a a/a |
|
35 | "$TESTDIR/svn-safe-append.py" a a/a | |
36 | echo % modify |
|
36 | echo % modify | |
37 | hg --cwd a ci -d '1 0' -m 'modify a file' |
|
37 | hg --cwd a ci -d '1 0' -m 'modify a file' | |
38 | hg --cwd a tip -q |
|
38 | hg --cwd a tip -q | |
39 |
|
39 | |||
40 | hg convert -d svn a |
|
40 | hg convert -d svn a | |
41 | svnupanddisplay a-hg-wc 2 |
|
41 | svnupanddisplay a-hg-wc 2 | |
42 | ls a a-hg-wc |
|
42 | ls a a-hg-wc | |
43 | cmp a/a a-hg-wc/a && echo same || echo different |
|
43 | cmp a/a a-hg-wc/a && echo same || echo different | |
44 |
|
44 | |||
45 | hg --cwd a mv a b |
|
45 | hg --cwd a mv a b | |
46 | echo % rename |
|
46 | echo % rename | |
47 | hg --cwd a ci -d '2 0' -m 'rename a file' |
|
47 | hg --cwd a ci -d '2 0' -m 'rename a file' | |
48 | hg --cwd a tip -q |
|
48 | hg --cwd a tip -q | |
49 |
|
49 | |||
50 | hg convert -d svn a |
|
50 | hg convert -d svn a | |
51 | svnupanddisplay a-hg-wc 1 |
|
51 | svnupanddisplay a-hg-wc 1 | |
52 | ls a a-hg-wc |
|
52 | ls a a-hg-wc | |
53 |
|
53 | |||
54 | hg --cwd a cp b c |
|
54 | hg --cwd a cp b c | |
55 | echo % copy |
|
55 | echo % copy | |
56 | hg --cwd a ci -d '3 0' -m 'copy a file' |
|
56 | hg --cwd a ci -d '3 0' -m 'copy a file' | |
57 | hg --cwd a tip -q |
|
57 | hg --cwd a tip -q | |
58 |
|
58 | |||
59 | hg convert -d svn a |
|
59 | hg convert -d svn a | |
60 | svnupanddisplay a-hg-wc 1 |
|
60 | svnupanddisplay a-hg-wc 1 | |
61 | ls a a-hg-wc |
|
61 | ls a a-hg-wc | |
62 |
|
62 | |||
63 | hg --cwd a rm b |
|
63 | hg --cwd a rm b | |
64 | echo % remove |
|
64 | echo % remove | |
65 | hg --cwd a ci -d '4 0' -m 'remove a file' |
|
65 | hg --cwd a ci -d '4 0' -m 'remove a file' | |
66 | hg --cwd a tip -q |
|
66 | hg --cwd a tip -q | |
67 |
|
67 | |||
68 | hg convert -d svn a |
|
68 | hg convert -d svn a | |
69 | svnupanddisplay a-hg-wc 1 |
|
69 | svnupanddisplay a-hg-wc 1 | |
70 | ls a a-hg-wc |
|
70 | ls a a-hg-wc | |
71 |
|
71 | |||
72 | chmod +x a/c |
|
72 | chmod +x a/c | |
73 | echo % executable |
|
73 | echo % executable | |
74 | hg --cwd a ci -d '5 0' -m 'make a file executable' |
|
74 | hg --cwd a ci -d '5 0' -m 'make a file executable' | |
75 | hg --cwd a tip -q |
|
75 | hg --cwd a tip -q | |
76 |
|
76 | |||
77 | hg convert -d svn a |
|
77 | hg convert -d svn a | |
78 | svnupanddisplay a-hg-wc 1 |
|
78 | svnupanddisplay a-hg-wc 1 | |
79 | test -x a-hg-wc/c && echo executable || echo not executable |
|
79 | test -x a-hg-wc/c && echo executable || echo not executable | |
80 |
|
80 | |||
81 | echo % executable in new directory |
|
81 | echo % executable in new directory | |
82 |
|
82 | |||
83 | rm -rf a a-hg a-hg-wc |
|
83 | rm -rf a a-hg a-hg-wc | |
84 | hg init a |
|
84 | hg init a | |
85 |
|
85 | |||
86 | mkdir a/d1 |
|
86 | mkdir a/d1 | |
87 | echo a > a/d1/a |
|
87 | echo a > a/d1/a | |
88 | chmod +x a/d1/a |
|
88 | chmod +x a/d1/a | |
89 | hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory' |
|
89 | hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory' | |
90 |
|
90 | |||
91 | hg convert -d svn a |
|
91 | hg convert -d svn a | |
92 | svnupanddisplay a-hg-wc 1 |
|
92 | svnupanddisplay a-hg-wc 1 | |
93 | test -x a-hg-wc/d1/a && echo executable || echo not executable |
|
93 | test -x a-hg-wc/d1/a && echo executable || echo not executable | |
94 |
|
94 | |||
95 | echo % copy to new directory |
|
95 | echo % copy to new directory | |
96 |
|
96 | |||
97 | mkdir a/d2 |
|
97 | mkdir a/d2 | |
98 | hg --cwd a cp d1/a d2/a |
|
98 | hg --cwd a cp d1/a d2/a | |
99 | hg --cwd a ci -d '1 0' -A -m 'copy file to new directory' |
|
99 | hg --cwd a ci -d '1 0' -A -m 'copy file to new directory' | |
100 |
|
100 | |||
101 | hg convert -d svn a |
|
101 | hg convert -d svn a | |
102 | svnupanddisplay a-hg-wc 1 |
|
102 | svnupanddisplay a-hg-wc 1 | |
103 |
|
103 | |||
104 | echo % branchy history |
|
104 | echo % branchy history | |
105 |
|
105 | |||
106 | hg init b |
|
106 | hg init b | |
107 | echo base > b/b |
|
107 | echo base > b/b | |
108 | hg --cwd b ci -d '0 0' -Ambase |
|
108 | hg --cwd b ci -d '0 0' -Ambase | |
109 |
|
109 | |||
110 | "$TESTDIR/svn-safe-append.py" left-1 b/b |
|
110 | "$TESTDIR/svn-safe-append.py" left-1 b/b | |
111 | echo left-1 > b/left-1 |
|
111 | echo left-1 > b/left-1 | |
112 | hg --cwd b ci -d '1 0' -Amleft-1 |
|
112 | hg --cwd b ci -d '1 0' -Amleft-1 | |
113 |
|
113 | |||
114 | "$TESTDIR/svn-safe-append.py" left-2 b/b |
|
114 | "$TESTDIR/svn-safe-append.py" left-2 b/b | |
115 | echo left-2 > b/left-2 |
|
115 | echo left-2 > b/left-2 | |
116 | hg --cwd b ci -d '2 0' -Amleft-2 |
|
116 | hg --cwd b ci -d '2 0' -Amleft-2 | |
117 |
|
117 | |||
118 | hg --cwd b up 0 |
|
118 | hg --cwd b up 0 | |
119 |
|
119 | |||
120 | "$TESTDIR/svn-safe-append.py" right-1 b/b |
|
120 | "$TESTDIR/svn-safe-append.py" right-1 b/b | |
121 | echo right-1 > b/right-1 |
|
121 | echo right-1 > b/right-1 | |
122 | hg --cwd b ci -d '3 0' -Amright-1 |
|
122 | hg --cwd b ci -d '3 0' -Amright-1 | |
123 |
|
123 | |||
124 | "$TESTDIR/svn-safe-append.py" right-2 b/b |
|
124 | "$TESTDIR/svn-safe-append.py" right-2 b/b | |
125 | echo right-2 > b/right-2 |
|
125 | echo right-2 > b/right-2 | |
126 | hg --cwd b ci -d '4 0' -Amright-2 |
|
126 | hg --cwd b ci -d '4 0' -Amright-2 | |
127 |
|
127 | |||
128 | hg --cwd b up -C 2 |
|
128 | hg --cwd b up -C 2 | |
129 | hg --cwd b merge |
|
129 | hg --cwd b merge | |
130 | hg --cwd b revert -r 2 b |
|
130 | hg --cwd b revert -r 2 b | |
131 | hg resolve -m b |
|
131 | hg resolve -m b | |
132 | hg --cwd b ci -d '5 0' -m 'merge' |
|
132 | hg --cwd b ci -d '5 0' -m 'merge' | |
133 |
|
133 | |||
134 | hg convert -d svn b |
|
134 | hg convert -d svn b | |
135 | echo % expect 4 changes |
|
135 | echo % expect 4 changes | |
136 | svnupanddisplay b-hg-wc 0 |
|
136 | svnupanddisplay b-hg-wc 0 |
@@ -1,25 +1,27 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 | # test command parsing and dispatch |
|
2 | # test command parsing and dispatch | |
3 |
|
3 | |||
|
4 | "$TESTDIR/hghave" no-outer-repo || exit 80 | |||
|
5 | ||||
4 | hg init a |
|
6 | hg init a | |
5 | cd a |
|
7 | cd a | |
6 | echo a > a |
|
8 | echo a > a | |
7 | hg ci -Ama -d '0 0' |
|
9 | hg ci -Ama -d '0 0' | |
8 |
|
10 | |||
9 | echo "# missing arg" |
|
11 | echo "# missing arg" | |
10 | hg cat |
|
12 | hg cat | |
11 |
|
13 | |||
12 | echo '% [defaults]' |
|
14 | echo '% [defaults]' | |
13 | hg cat a |
|
15 | hg cat a | |
14 | cat >> $HGRCPATH <<EOF |
|
16 | cat >> $HGRCPATH <<EOF | |
15 | [defaults] |
|
17 | [defaults] | |
16 | cat = -v |
|
18 | cat = -v | |
17 | EOF |
|
19 | EOF | |
18 | hg cat a |
|
20 | hg cat a | |
19 |
|
21 | |||
20 | echo '% no repo' |
|
22 | echo '% no repo' | |
21 | cd .. |
|
23 | cd .. | |
22 | hg cat |
|
24 | hg cat | |
23 |
|
25 | |||
24 | exit 0 |
|
26 | exit 0 | |
25 |
|
27 |
@@ -1,104 +1,106 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 | # Test basic extension support |
|
2 | # Test basic extension support | |
3 |
|
3 | |||
|
4 | "$TESTDIR/hghave" no-outer-repo || exit 80 | |||
|
5 | ||||
4 | cat > foobar.py <<EOF |
|
6 | cat > foobar.py <<EOF | |
5 | import os |
|
7 | import os | |
6 | from mercurial import commands |
|
8 | from mercurial import commands | |
7 |
|
9 | |||
8 | def uisetup(ui): |
|
10 | def uisetup(ui): | |
9 | ui.write("uisetup called\\n") |
|
11 | ui.write("uisetup called\\n") | |
10 | ui.write("ui.parentui is%s None\\n" % (ui.parentui is not None |
|
12 | ui.write("ui.parentui is%s None\\n" % (ui.parentui is not None | |
11 | and "not" or "")) |
|
13 | and "not" or "")) | |
12 |
|
14 | |||
13 | def reposetup(ui, repo): |
|
15 | def reposetup(ui, repo): | |
14 | ui.write("reposetup called for %s\\n" % os.path.basename(repo.root)) |
|
16 | ui.write("reposetup called for %s\\n" % os.path.basename(repo.root)) | |
15 | ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!")) |
|
17 | ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!")) | |
16 |
|
18 | |||
17 | def foo(ui, *args, **kwargs): |
|
19 | def foo(ui, *args, **kwargs): | |
18 | ui.write("Foo\\n") |
|
20 | ui.write("Foo\\n") | |
19 |
|
21 | |||
20 | def bar(ui, *args, **kwargs): |
|
22 | def bar(ui, *args, **kwargs): | |
21 | ui.write("Bar\\n") |
|
23 | ui.write("Bar\\n") | |
22 |
|
24 | |||
23 | cmdtable = { |
|
25 | cmdtable = { | |
24 | "foo": (foo, [], "hg foo"), |
|
26 | "foo": (foo, [], "hg foo"), | |
25 | "bar": (bar, [], "hg bar"), |
|
27 | "bar": (bar, [], "hg bar"), | |
26 | } |
|
28 | } | |
27 |
|
29 | |||
28 | commands.norepo += ' bar' |
|
30 | commands.norepo += ' bar' | |
29 | EOF |
|
31 | EOF | |
30 | abspath=`pwd`/foobar.py |
|
32 | abspath=`pwd`/foobar.py | |
31 |
|
33 | |||
32 | mkdir barfoo |
|
34 | mkdir barfoo | |
33 | cp foobar.py barfoo/__init__.py |
|
35 | cp foobar.py barfoo/__init__.py | |
34 | barfoopath=`pwd`/barfoo |
|
36 | barfoopath=`pwd`/barfoo | |
35 |
|
37 | |||
36 | hg init a |
|
38 | hg init a | |
37 | cd a |
|
39 | cd a | |
38 | echo foo > file |
|
40 | echo foo > file | |
39 | hg add file |
|
41 | hg add file | |
40 | hg commit -m 'add file' |
|
42 | hg commit -m 'add file' | |
41 |
|
43 | |||
42 | echo '[extensions]' >> $HGRCPATH |
|
44 | echo '[extensions]' >> $HGRCPATH | |
43 | echo "foobar = $abspath" >> $HGRCPATH |
|
45 | echo "foobar = $abspath" >> $HGRCPATH | |
44 | hg foo |
|
46 | hg foo | |
45 |
|
47 | |||
46 | cd .. |
|
48 | cd .. | |
47 | hg clone a b |
|
49 | hg clone a b | |
48 |
|
50 | |||
49 | hg bar |
|
51 | hg bar | |
50 | echo 'foobar = !' >> $HGRCPATH |
|
52 | echo 'foobar = !' >> $HGRCPATH | |
51 |
|
53 | |||
52 | echo '% module/__init__.py-style' |
|
54 | echo '% module/__init__.py-style' | |
53 | echo "barfoo = $barfoopath" >> $HGRCPATH |
|
55 | echo "barfoo = $barfoopath" >> $HGRCPATH | |
54 | cd a |
|
56 | cd a | |
55 | hg foo |
|
57 | hg foo | |
56 | echo 'barfoo = !' >> $HGRCPATH |
|
58 | echo 'barfoo = !' >> $HGRCPATH | |
57 |
|
59 | |||
58 | cd .. |
|
60 | cd .. | |
59 | cat > empty.py <<EOF |
|
61 | cat > empty.py <<EOF | |
60 | '''empty cmdtable |
|
62 | '''empty cmdtable | |
61 | ''' |
|
63 | ''' | |
62 | cmdtable = {} |
|
64 | cmdtable = {} | |
63 | EOF |
|
65 | EOF | |
64 | emptypath=`pwd`/empty.py |
|
66 | emptypath=`pwd`/empty.py | |
65 | echo "empty = $emptypath" >> $HGRCPATH |
|
67 | echo "empty = $emptypath" >> $HGRCPATH | |
66 | hg help empty |
|
68 | hg help empty | |
67 | echo 'empty = !' >> $HGRCPATH |
|
69 | echo 'empty = !' >> $HGRCPATH | |
68 |
|
70 | |||
69 | cat > debugextension.py <<EOF |
|
71 | cat > debugextension.py <<EOF | |
70 | '''only debugcommands |
|
72 | '''only debugcommands | |
71 | ''' |
|
73 | ''' | |
72 | def debugfoobar(ui, repo, *args, **opts): |
|
74 | def debugfoobar(ui, repo, *args, **opts): | |
73 | "yet another debug command" |
|
75 | "yet another debug command" | |
74 | pass |
|
76 | pass | |
75 |
|
77 | |||
76 | cmdtable = {"debugfoobar": (debugfoobar, (), "hg debugfoobar")} |
|
78 | cmdtable = {"debugfoobar": (debugfoobar, (), "hg debugfoobar")} | |
77 | EOF |
|
79 | EOF | |
78 | debugpath=`pwd`/debugextension.py |
|
80 | debugpath=`pwd`/debugextension.py | |
79 | echo "debugextension = $debugpath" >> $HGRCPATH |
|
81 | echo "debugextension = $debugpath" >> $HGRCPATH | |
80 | hg help debugextension |
|
82 | hg help debugextension | |
81 | hg --debug help debugextension |
|
83 | hg --debug help debugextension | |
82 | echo 'debugextension = !' >> $HGRCPATH |
|
84 | echo 'debugextension = !' >> $HGRCPATH | |
83 |
|
85 | |||
84 | echo % issue811 |
|
86 | echo % issue811 | |
85 | debugpath=`pwd`/debugissue811.py |
|
87 | debugpath=`pwd`/debugissue811.py | |
86 | cat > debugissue811.py <<EOF |
|
88 | cat > debugissue811.py <<EOF | |
87 | '''show all loaded extensions |
|
89 | '''show all loaded extensions | |
88 | ''' |
|
90 | ''' | |
89 | from mercurial import extensions, commands |
|
91 | from mercurial import extensions, commands | |
90 |
|
92 | |||
91 | def debugextensions(ui): |
|
93 | def debugextensions(ui): | |
92 | "yet another debug command" |
|
94 | "yet another debug command" | |
93 | ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()])) |
|
95 | ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()])) | |
94 |
|
96 | |||
95 | cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")} |
|
97 | cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")} | |
96 | commands.norepo += " debugextensions" |
|
98 | commands.norepo += " debugextensions" | |
97 | EOF |
|
99 | EOF | |
98 | echo "debugissue811 = $debugpath" >> $HGRCPATH |
|
100 | echo "debugissue811 = $debugpath" >> $HGRCPATH | |
99 | echo "mq=" >> $HGRCPATH |
|
101 | echo "mq=" >> $HGRCPATH | |
100 | echo "hgext.mq=" >> $HGRCPATH |
|
102 | echo "hgext.mq=" >> $HGRCPATH | |
101 | echo "hgext/mq=" >> $HGRCPATH |
|
103 | echo "hgext/mq=" >> $HGRCPATH | |
102 |
|
104 | |||
103 | echo % show extensions |
|
105 | echo % show extensions | |
104 | hg debugextensions |
|
106 | hg debugextensions |
@@ -1,94 +1,96 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
|
3 | "$TESTDIR/hghave" no-outer-repo || exit 80 | |||
|
4 | ||||
3 | hg init a |
|
5 | hg init a | |
4 | cd a |
|
6 | cd a | |
5 | echo a > a |
|
7 | echo a > a | |
6 | hg ci -A -d'1 0' -m a |
|
8 | hg ci -A -d'1 0' -m a | |
7 |
|
9 | |||
8 | cd .. |
|
10 | cd .. | |
9 |
|
11 | |||
10 | hg init b |
|
12 | hg init b | |
11 | cd b |
|
13 | cd b | |
12 | echo b > b |
|
14 | echo b > b | |
13 | hg ci -A -d'1 0' -m b |
|
15 | hg ci -A -d'1 0' -m b | |
14 |
|
16 | |||
15 | cd .. |
|
17 | cd .. | |
16 |
|
18 | |||
17 | hg clone a c |
|
19 | hg clone a c | |
18 | cd c |
|
20 | cd c | |
19 | hg pull -f ../b |
|
21 | hg pull -f ../b | |
20 | hg merge |
|
22 | hg merge | |
21 |
|
23 | |||
22 | cd .. |
|
24 | cd .. | |
23 |
|
25 | |||
24 | echo %% -R/--repository |
|
26 | echo %% -R/--repository | |
25 | hg -R a tip |
|
27 | hg -R a tip | |
26 | hg --repository b tip |
|
28 | hg --repository b tip | |
27 |
|
29 | |||
28 | echo %% implicit -R |
|
30 | echo %% implicit -R | |
29 | hg ann a/a |
|
31 | hg ann a/a | |
30 | hg ann a/a a/a |
|
32 | hg ann a/a a/a | |
31 | hg ann a/a b/b |
|
33 | hg ann a/a b/b | |
32 | hg -R b ann a/a |
|
34 | hg -R b ann a/a | |
33 | hg log |
|
35 | hg log | |
34 |
|
36 | |||
35 | echo %% abbrev of long option |
|
37 | echo %% abbrev of long option | |
36 | hg --repo c tip |
|
38 | hg --repo c tip | |
37 |
|
39 | |||
38 | echo "%% earlygetopt with duplicate options (36d23de02da1)" |
|
40 | echo "%% earlygetopt with duplicate options (36d23de02da1)" | |
39 | hg --cwd a --cwd b --cwd c tip |
|
41 | hg --cwd a --cwd b --cwd c tip | |
40 | hg --repo c --repository b -R a tip |
|
42 | hg --repo c --repository b -R a tip | |
41 |
|
43 | |||
42 | echo "%% earlygetopt short option without following space" |
|
44 | echo "%% earlygetopt short option without following space" | |
43 | hg -q -Rb tip |
|
45 | hg -q -Rb tip | |
44 |
|
46 | |||
45 | echo "%% earlygetopt with illegal abbreviations" |
|
47 | echo "%% earlygetopt with illegal abbreviations" | |
46 | hg --confi "foo.bar=baz" |
|
48 | hg --confi "foo.bar=baz" | |
47 | hg --cw a tip |
|
49 | hg --cw a tip | |
48 | hg --rep a tip |
|
50 | hg --rep a tip | |
49 | hg --repositor a tip |
|
51 | hg --repositor a tip | |
50 | hg -qR a tip |
|
52 | hg -qR a tip | |
51 | hg -qRa tip |
|
53 | hg -qRa tip | |
52 |
|
54 | |||
53 | echo %% --cwd |
|
55 | echo %% --cwd | |
54 | hg --cwd a parents |
|
56 | hg --cwd a parents | |
55 |
|
57 | |||
56 | echo %% -y/--noninteractive - just be sure it is parsed |
|
58 | echo %% -y/--noninteractive - just be sure it is parsed | |
57 | hg --cwd a tip -q --noninteractive |
|
59 | hg --cwd a tip -q --noninteractive | |
58 | hg --cwd a tip -q -y |
|
60 | hg --cwd a tip -q -y | |
59 |
|
61 | |||
60 | echo %% -q/--quiet |
|
62 | echo %% -q/--quiet | |
61 | hg -R a -q tip |
|
63 | hg -R a -q tip | |
62 | hg -R b -q tip |
|
64 | hg -R b -q tip | |
63 | hg -R c --quiet parents |
|
65 | hg -R c --quiet parents | |
64 |
|
66 | |||
65 | echo %% -v/--verbose |
|
67 | echo %% -v/--verbose | |
66 | hg --cwd c head -v |
|
68 | hg --cwd c head -v | |
67 | hg --cwd b tip --verbose |
|
69 | hg --cwd b tip --verbose | |
68 |
|
70 | |||
69 | echo %% --config |
|
71 | echo %% --config | |
70 | hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo |
|
72 | hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo | |
71 | hg --cwd c --config '' tip -q |
|
73 | hg --cwd c --config '' tip -q | |
72 | hg --cwd c --config a.b tip -q |
|
74 | hg --cwd c --config a.b tip -q | |
73 | hg --cwd c --config a tip -q |
|
75 | hg --cwd c --config a tip -q | |
74 | hg --cwd c --config a.= tip -q |
|
76 | hg --cwd c --config a.= tip -q | |
75 | hg --cwd c --config .b= tip -q |
|
77 | hg --cwd c --config .b= tip -q | |
76 |
|
78 | |||
77 | echo %% --debug |
|
79 | echo %% --debug | |
78 | hg --cwd c log --debug |
|
80 | hg --cwd c log --debug | |
79 |
|
81 | |||
80 | echo %% --traceback |
|
82 | echo %% --traceback | |
81 | hg --cwd c --config x --traceback tip 2>&1 | grep -i 'traceback' |
|
83 | hg --cwd c --config x --traceback tip 2>&1 | grep -i 'traceback' | |
82 |
|
84 | |||
83 | echo %% --time |
|
85 | echo %% --time | |
84 | hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g' |
|
86 | hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g' | |
85 |
|
87 | |||
86 | echo %% --version |
|
88 | echo %% --version | |
87 | hg --version -q | sed 's/version [^)]*/version xxx/' |
|
89 | hg --version -q | sed 's/version [^)]*/version xxx/' | |
88 |
|
90 | |||
89 | echo %% -h/--help |
|
91 | echo %% -h/--help | |
90 | hg -h |
|
92 | hg -h | |
91 | hg --help |
|
93 | hg --help | |
92 |
|
94 | |||
93 | echo %% not tested: --debugger |
|
95 | echo %% not tested: --debugger | |
94 |
|
96 |
@@ -1,166 +1,168 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | # @ (34) head |
|
3 | # @ (34) head | |
4 | # | |
|
4 | # | | |
5 | # | o (33) head |
|
5 | # | o (33) head | |
6 | # | | |
|
6 | # | | | |
7 | # o | (32) expand |
|
7 | # o | (32) expand | |
8 | # |\ \ |
|
8 | # |\ \ | |
9 | # | o \ (31) expand |
|
9 | # | o \ (31) expand | |
10 | # | |\ \ |
|
10 | # | |\ \ | |
11 | # | | o \ (30) expand |
|
11 | # | | o \ (30) expand | |
12 | # | | |\ \ |
|
12 | # | | |\ \ | |
13 | # | | | o | (29) regular commit |
|
13 | # | | | o | (29) regular commit | |
14 | # | | | | | |
|
14 | # | | | | | | |
15 | # | | o | | (28) merge zero known |
|
15 | # | | o | | (28) merge zero known | |
16 | # | | |\ \ \ |
|
16 | # | | |\ \ \ | |
17 | # o | | | | | (27) collapse |
|
17 | # o | | | | | (27) collapse | |
18 | # |/ / / / / |
|
18 | # |/ / / / / | |
19 | # | | o---+ (26) merge one known; far right |
|
19 | # | | o---+ (26) merge one known; far right | |
20 | # | | | | | |
|
20 | # | | | | | | |
21 | # +---o | | (25) merge one known; far left |
|
21 | # +---o | | (25) merge one known; far left | |
22 | # | | | | | |
|
22 | # | | | | | | |
23 | # | | o | | (24) merge one known; immediate right |
|
23 | # | | o | | (24) merge one known; immediate right | |
24 | # | | |\| | |
|
24 | # | | |\| | | |
25 | # | | o | | (23) merge one known; immediate left |
|
25 | # | | o | | (23) merge one known; immediate left | |
26 | # | |/| | | |
|
26 | # | |/| | | | |
27 | # +---o---+ (22) merge two known; one far left, one far right |
|
27 | # +---o---+ (22) merge two known; one far left, one far right | |
28 | # | | / / |
|
28 | # | | / / | |
29 | # o | | | (21) expand |
|
29 | # o | | | (21) expand | |
30 | # |\ \ \ \ |
|
30 | # |\ \ \ \ | |
31 | # | o---+-+ (20) merge two known; two far right |
|
31 | # | o---+-+ (20) merge two known; two far right | |
32 | # | / / / |
|
32 | # | / / / | |
33 | # o | | | (19) expand |
|
33 | # o | | | (19) expand | |
34 | # |\ \ \ \ |
|
34 | # |\ \ \ \ | |
35 | # +---+---o (18) merge two known; two far left |
|
35 | # +---+---o (18) merge two known; two far left | |
36 | # | | | | |
|
36 | # | | | | | |
37 | # | o | | (17) expand |
|
37 | # | o | | (17) expand | |
38 | # | |\ \ \ |
|
38 | # | |\ \ \ | |
39 | # | | o---+ (16) merge two known; one immediate right, one near right |
|
39 | # | | o---+ (16) merge two known; one immediate right, one near right | |
40 | # | | |/ / |
|
40 | # | | |/ / | |
41 | # o | | | (15) expand |
|
41 | # o | | | (15) expand | |
42 | # |\ \ \ \ |
|
42 | # |\ \ \ \ | |
43 | # | o-----+ (14) merge two known; one immediate right, one far right |
|
43 | # | o-----+ (14) merge two known; one immediate right, one far right | |
44 | # | |/ / / |
|
44 | # | |/ / / | |
45 | # o | | | (13) expand |
|
45 | # o | | | (13) expand | |
46 | # |\ \ \ \ |
|
46 | # |\ \ \ \ | |
47 | # +---o | | (12) merge two known; one immediate right, one far left |
|
47 | # +---o | | (12) merge two known; one immediate right, one far left | |
48 | # | | |/ / |
|
48 | # | | |/ / | |
49 | # | o | | (11) expand |
|
49 | # | o | | (11) expand | |
50 | # | |\ \ \ |
|
50 | # | |\ \ \ | |
51 | # | | o---+ (10) merge two known; one immediate left, one near right |
|
51 | # | | o---+ (10) merge two known; one immediate left, one near right | |
52 | # | |/ / / |
|
52 | # | |/ / / | |
53 | # o | | | (9) expand |
|
53 | # o | | | (9) expand | |
54 | # |\ \ \ \ |
|
54 | # |\ \ \ \ | |
55 | # | o-----+ (8) merge two known; one immediate left, one far right |
|
55 | # | o-----+ (8) merge two known; one immediate left, one far right | |
56 | # |/ / / / |
|
56 | # |/ / / / | |
57 | # o | | | (7) expand |
|
57 | # o | | | (7) expand | |
58 | # |\ \ \ \ |
|
58 | # |\ \ \ \ | |
59 | # +---o | | (6) merge two known; one immediate left, one far left |
|
59 | # +---o | | (6) merge two known; one immediate left, one far left | |
60 | # | |/ / / |
|
60 | # | |/ / / | |
61 | # | o | | (5) expand |
|
61 | # | o | | (5) expand | |
62 | # | |\ \ \ |
|
62 | # | |\ \ \ | |
63 | # | | o | | (4) merge two known; one immediate left, one immediate right |
|
63 | # | | o | | (4) merge two known; one immediate left, one immediate right | |
64 | # | |/|/ / |
|
64 | # | |/|/ / | |
65 | # | o / / (3) collapse |
|
65 | # | o / / (3) collapse | |
66 | # |/ / / |
|
66 | # |/ / / | |
67 | # o / / (2) collapse |
|
67 | # o / / (2) collapse | |
68 | # |/ / |
|
68 | # |/ / | |
69 | # o / (1) collapse |
|
69 | # o / (1) collapse | |
70 | # |/ |
|
70 | # |/ | |
71 | # o (0) root |
|
71 | # o (0) root | |
72 |
|
72 | |||
|
73 | "$TESTDIR/hghave" no-outer-repo || exit 80 | |||
|
74 | ||||
73 | set -e |
|
75 | set -e | |
74 |
|
76 | |||
75 | commit() |
|
77 | commit() | |
76 | { |
|
78 | { | |
77 | rev=$1 |
|
79 | rev=$1 | |
78 | msg=$2 |
|
80 | msg=$2 | |
79 | shift 2 |
|
81 | shift 2 | |
80 | if [ "$#" -gt 0 ]; then |
|
82 | if [ "$#" -gt 0 ]; then | |
81 | hg debugsetparents "$@" |
|
83 | hg debugsetparents "$@" | |
82 | fi |
|
84 | fi | |
83 | echo $rev > $rev |
|
85 | echo $rev > $rev | |
84 | hg add $rev |
|
86 | hg add $rev | |
85 | hg rawcommit -q -d "$rev 0" -m "($rev) $msg" $rev |
|
87 | hg rawcommit -q -d "$rev 0" -m "($rev) $msg" $rev | |
86 | } |
|
88 | } | |
87 |
|
89 | |||
88 | echo "[extensions]" >> $HGRCPATH |
|
90 | echo "[extensions]" >> $HGRCPATH | |
89 | echo "graphlog=" >> $HGRCPATH |
|
91 | echo "graphlog=" >> $HGRCPATH | |
90 |
|
92 | |||
91 | echo % init |
|
93 | echo % init | |
92 | hg init repo |
|
94 | hg init repo | |
93 |
|
95 | |||
94 | cd repo |
|
96 | cd repo | |
95 |
|
97 | |||
96 | echo % empty repo |
|
98 | echo % empty repo | |
97 | hg glog |
|
99 | hg glog | |
98 |
|
100 | |||
99 | echo % building tree |
|
101 | echo % building tree | |
100 | commit 0 "root" |
|
102 | commit 0 "root" | |
101 | commit 1 "collapse" 0 |
|
103 | commit 1 "collapse" 0 | |
102 | commit 2 "collapse" 1 |
|
104 | commit 2 "collapse" 1 | |
103 | commit 3 "collapse" 2 |
|
105 | commit 3 "collapse" 2 | |
104 | commit 4 "merge two known; one immediate left, one immediate right" 1 3 |
|
106 | commit 4 "merge two known; one immediate left, one immediate right" 1 3 | |
105 | commit 5 "expand" 3 4 |
|
107 | commit 5 "expand" 3 4 | |
106 | commit 6 "merge two known; one immediate left, one far left" 2 5 |
|
108 | commit 6 "merge two known; one immediate left, one far left" 2 5 | |
107 | commit 7 "expand" 2 5 |
|
109 | commit 7 "expand" 2 5 | |
108 | commit 8 "merge two known; one immediate left, one far right" 0 7 |
|
110 | commit 8 "merge two known; one immediate left, one far right" 0 7 | |
109 | commit 9 "expand" 7 8 |
|
111 | commit 9 "expand" 7 8 | |
110 | commit 10 "merge two known; one immediate left, one near right" 0 6 |
|
112 | commit 10 "merge two known; one immediate left, one near right" 0 6 | |
111 | commit 11 "expand" 6 10 |
|
113 | commit 11 "expand" 6 10 | |
112 | commit 12 "merge two known; one immediate right, one far left" 1 9 |
|
114 | commit 12 "merge two known; one immediate right, one far left" 1 9 | |
113 | commit 13 "expand" 9 11 |
|
115 | commit 13 "expand" 9 11 | |
114 | commit 14 "merge two known; one immediate right, one far right" 0 12 |
|
116 | commit 14 "merge two known; one immediate right, one far right" 0 12 | |
115 | commit 15 "expand" 13 14 |
|
117 | commit 15 "expand" 13 14 | |
116 | commit 16 "merge two known; one immediate right, one near right" 0 1 |
|
118 | commit 16 "merge two known; one immediate right, one near right" 0 1 | |
117 | commit 17 "expand" 12 16 |
|
119 | commit 17 "expand" 12 16 | |
118 | commit 18 "merge two known; two far left" 1 15 |
|
120 | commit 18 "merge two known; two far left" 1 15 | |
119 | commit 19 "expand" 15 17 |
|
121 | commit 19 "expand" 15 17 | |
120 | commit 20 "merge two known; two far right" 0 18 |
|
122 | commit 20 "merge two known; two far right" 0 18 | |
121 | commit 21 "expand" 19 20 |
|
123 | commit 21 "expand" 19 20 | |
122 | commit 22 "merge two known; one far left, one far right" 18 21 |
|
124 | commit 22 "merge two known; one far left, one far right" 18 21 | |
123 | commit 23 "merge one known; immediate left" 1 22 |
|
125 | commit 23 "merge one known; immediate left" 1 22 | |
124 | commit 24 "merge one known; immediate right" 0 23 |
|
126 | commit 24 "merge one known; immediate right" 0 23 | |
125 | commit 25 "merge one known; far left" 21 24 |
|
127 | commit 25 "merge one known; far left" 21 24 | |
126 | commit 26 "merge one known; far right" 18 25 |
|
128 | commit 26 "merge one known; far right" 18 25 | |
127 | commit 27 "collapse" 21 |
|
129 | commit 27 "collapse" 21 | |
128 | commit 28 "merge zero known" 1 26 |
|
130 | commit 28 "merge zero known" 1 26 | |
129 | commit 29 "regular commit" 0 |
|
131 | commit 29 "regular commit" 0 | |
130 | commit 30 "expand" 28 29 |
|
132 | commit 30 "expand" 28 29 | |
131 | commit 31 "expand" 21 30 |
|
133 | commit 31 "expand" 21 30 | |
132 | commit 32 "expand" 27 31 |
|
134 | commit 32 "expand" 27 31 | |
133 | commit 33 "head" 18 |
|
135 | commit 33 "head" 18 | |
134 | commit 34 "head" 32 |
|
136 | commit 34 "head" 32 | |
135 |
|
137 | |||
136 | echo % glog -q |
|
138 | echo % glog -q | |
137 | hg glog -q |
|
139 | hg glog -q | |
138 |
|
140 | |||
139 | echo % glog |
|
141 | echo % glog | |
140 | hg glog |
|
142 | hg glog | |
141 |
|
143 | |||
142 | echo % file glog |
|
144 | echo % file glog | |
143 | hg glog 5 |
|
145 | hg glog 5 | |
144 |
|
146 | |||
145 | echo % unused arguments |
|
147 | echo % unused arguments | |
146 | hg glog -q foo bar || echo failed |
|
148 | hg glog -q foo bar || echo failed | |
147 |
|
149 | |||
148 | echo % from outer space |
|
150 | echo % from outer space | |
149 | cd .. |
|
151 | cd .. | |
150 | hg glog -l1 repo |
|
152 | hg glog -l1 repo | |
151 | hg glog -l1 repo/0 |
|
153 | hg glog -l1 repo/0 | |
152 | hg glog -l1 repo/missing |
|
154 | hg glog -l1 repo/missing | |
153 |
|
155 | |||
154 | echo % file log with revs != cset revs |
|
156 | echo % file log with revs != cset revs | |
155 | hg init flog |
|
157 | hg init flog | |
156 | cd flog |
|
158 | cd flog | |
157 | echo one >one |
|
159 | echo one >one | |
158 | hg add one |
|
160 | hg add one | |
159 | hg commit -mone |
|
161 | hg commit -mone | |
160 | echo two >two |
|
162 | echo two >two | |
161 | hg add two |
|
163 | hg add two | |
162 | hg commit -mtwo |
|
164 | hg commit -mtwo | |
163 | echo more >two |
|
165 | echo more >two | |
164 | hg commit -mmore |
|
166 | hg commit -mmore | |
165 | hg glog two |
|
167 | hg glog two | |
166 |
|
168 |
General Comments 0
You need to be logged in to leave comments.
Login now