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