##// END OF EJS Templates
Merge with crew-stable.
Alexis S. L. Carvalho -
r4325:aa26759c merge default
parent child Browse files
Show More
@@ -1268,6 +1268,23 b' def help_(ui, name=None, with_version=Fa'
1268 commands it provides."""
1268 commands it provides."""
1269 option_lists = []
1269 option_lists = []
1270
1270
1271 def addglobalopts(aliases):
1272 if ui.verbose:
1273 option_lists.append((_("global options:"), globalopts))
1274 if name == 'shortlist':
1275 option_lists.append((_('use "hg help" for the full list '
1276 'of commands'), ()))
1277 else:
1278 if name == 'shortlist':
1279 msg = _('use "hg help" for the full list of commands '
1280 'or "hg -v" for details')
1281 elif aliases:
1282 msg = _('use "hg -v help%s" to show aliases and '
1283 'global options') % (name and " " + name or "")
1284 else:
1285 msg = _('use "hg -v help %s" to show global options') % name
1286 option_lists.append((msg, ()))
1287
1271 def helpcmd(name):
1288 def helpcmd(name):
1272 if with_version:
1289 if with_version:
1273 version_(ui)
1290 version_(ui)
@@ -1291,7 +1308,9 b' def help_(ui, name=None, with_version=Fa'
1291
1308
1292 # options
1309 # options
1293 if i[1]:
1310 if i[1]:
1294 option_lists.append(("options", i[1]))
1311 option_lists.append((_("options:\n"), i[1]))
1312
1313 addglobalopts(False)
1295
1314
1296 def helplist(select=None):
1315 def helplist(select=None):
1297 h = {}
1316 h = {}
@@ -1321,6 +1340,9 b' def help_(ui, name=None, with_version=Fa'
1321 else:
1340 else:
1322 ui.write(' %-*s %s\n' % (m, f, h[f]))
1341 ui.write(' %-*s %s\n' % (m, f, h[f]))
1323
1342
1343 if not ui.quiet:
1344 addglobalopts(True)
1345
1324 def helptopic(name):
1346 def helptopic(name):
1325 v = None
1347 v = None
1326 for i in help.helptable:
1348 for i in help.helptable:
@@ -1360,12 +1382,7 b' def help_(ui, name=None, with_version=Fa'
1360 ui.status(_('no commands defined\n'))
1382 ui.status(_('no commands defined\n'))
1361 return
1383 return
1362
1384
1363 if ui.verbose:
1385 ui.status(_('list of commands:\n\n'))
1364 ui.status(_('list of commands:\n\n'))
1365 else:
1366 ui.status(_('list of commands (use "hg help -v %s" '
1367 'to show aliases and global options):\n\n') % name)
1368
1369 modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct])
1386 modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct])
1370 helplist(modcmds.has_key)
1387 helplist(modcmds.has_key)
1371
1388
@@ -1391,24 +1408,16 b' def help_(ui, name=None, with_version=Fa'
1391
1408
1392 # list of commands
1409 # list of commands
1393 if name == "shortlist":
1410 if name == "shortlist":
1394 ui.status(_('basic commands (use "hg help" '
1411 ui.status(_('basic commands:\n\n'))
1395 'for the full list or option "-v" for details):\n\n'))
1412 else:
1396 elif ui.verbose:
1397 ui.status(_('list of commands:\n\n'))
1413 ui.status(_('list of commands:\n\n'))
1398 else:
1399 ui.status(_('list of commands (use "hg help -v" '
1400 'to show aliases and global options):\n\n'))
1401
1414
1402 helplist()
1415 helplist()
1403
1416
1404 # global options
1405 if ui.verbose:
1406 option_lists.append(("global options", globalopts))
1407
1408 # list all option lists
1417 # list all option lists
1409 opt_output = []
1418 opt_output = []
1410 for title, options in option_lists:
1419 for title, options in option_lists:
1411 opt_output.append(("\n%s:\n" % title, None))
1420 opt_output.append(("\n%s" % title, None))
1412 for shortopt, longopt, default, desc in options:
1421 for shortopt, longopt, default, desc in options:
1413 if "DEPRECATED" in desc and not ui.verbose: continue
1422 if "DEPRECATED" in desc and not ui.verbose: continue
1414 opt_output.append(("%2s%s" % (shortopt and "-%s" % shortopt,
1423 opt_output.append(("%2s%s" % (shortopt and "-%s" % shortopt,
@@ -1419,7 +1428,7 b' def help_(ui, name=None, with_version=Fa'
1419 or "")))
1428 or "")))
1420
1429
1421 if opt_output:
1430 if opt_output:
1422 opts_len = max([len(line[0]) for line in opt_output if line[1]])
1431 opts_len = max([len(line[0]) for line in opt_output if line[1]] or [0])
1423 for first, second in opt_output:
1432 for first, second in opt_output:
1424 if second:
1433 if second:
1425 ui.write(" %-*s %s\n" % (opts_len, first, second))
1434 ui.write(" %-*s %s\n" % (opts_len, first, second))
@@ -1775,7 +1784,7 b' def log(ui, repo, *pats, **opts):'
1775 for k in [kw.lower() for kw in opts['keyword']]:
1784 for k in [kw.lower() for kw in opts['keyword']]:
1776 if not (k in changes[1].lower() or
1785 if not (k in changes[1].lower() or
1777 k in changes[4].lower() or
1786 k in changes[4].lower() or
1778 k in " ".join(changes[3][:20]).lower()):
1787 k in " ".join(changes[3]).lower()):
1779 miss = 1
1788 miss = 1
1780 break
1789 break
1781 if miss:
1790 if miss:
@@ -2845,7 +2854,7 b' table = {'
2845 _('only follow the first parent of merge changesets')),
2854 _('only follow the first parent of merge changesets')),
2846 ('d', 'date', '', _('show revs matching date spec')),
2855 ('d', 'date', '', _('show revs matching date spec')),
2847 ('C', 'copies', None, _('show copied files')),
2856 ('C', 'copies', None, _('show copied files')),
2848 ('k', 'keyword', [], _('search for a keyword')),
2857 ('k', 'keyword', [], _('do case-insensitive search for a keyword')),
2849 ('l', 'limit', '', _('limit number of changes displayed')),
2858 ('l', 'limit', '', _('limit number of changes displayed')),
2850 ('r', 'rev', [], _('show the specified revision or range')),
2859 ('r', 'rev', [], _('show the specified revision or range')),
2851 ('', 'removed', None, _('include revs where files were removed')),
2860 ('', 'removed', None, _('include revs where files were removed')),
@@ -257,7 +257,7 b' class hgweb(object):'
257 for q in qw:
257 for q in qw:
258 if not (q in ctx.user().lower() or
258 if not (q in ctx.user().lower() or
259 q in ctx.description().lower() or
259 q in ctx.description().lower() or
260 q in " ".join(ctx.files()[:20]).lower()):
260 q in " ".join(ctx.files()).lower()):
261 miss = 1
261 miss = 1
262 break
262 break
263 if miss:
263 if miss:
@@ -635,6 +635,8 b" def export(repo, revs, template='hg-%h.p"
635 single(rev, seqno+1, fp)
635 single(rev, seqno+1, fp)
636
636
637 def diffstat(patchlines):
637 def diffstat(patchlines):
638 if not util.find_in_path('diffstat', os.environ.get('PATH', '')):
639 return
638 fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt")
640 fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt")
639 try:
641 try:
640 p = popen2.Popen3('diffstat -p1 -w79 2>/dev/null > ' + name)
642 p = popen2.Popen3('diffstat -p1 -w79 2>/dev/null > ' + name)
@@ -210,7 +210,7 b' class lazyparser(object):'
210 end = end * self.s
210 end = end * self.s
211 blocksize = end - blockstart
211 blocksize = end - blockstart
212 else:
212 else:
213 blockstart = (i & ~(32)) * self.s
213 blockstart = (i & ~63) * self.s
214 blocksize = self.s * 64
214 blocksize = self.s * 64
215 end = blockstart + blocksize
215 end = blockstart + blocksize
216 while blockstart < end:
216 while blockstart < end:
@@ -45,6 +45,7 b' parser.set_defaults(timeout=180)'
45 (options, args) = parser.parse_args()
45 (options, args) = parser.parse_args()
46 verbose = options.verbose
46 verbose = options.verbose
47 coverage = options.cover or options.cover_stdlib or options.annotate
47 coverage = options.cover or options.cover_stdlib or options.annotate
48 python = sys.executable
48
49
49 def vlog(*msg):
50 def vlog(*msg):
50 if verbose:
51 if verbose:
@@ -115,6 +116,7 b' def use_correct_python():'
115 shutil.copymode(sys.executable, my_python)
116 shutil.copymode(sys.executable, my_python)
116
117
117 def install_hg():
118 def install_hg():
119 global python
118 vlog("# Performing temporary installation of HG")
120 vlog("# Performing temporary installation of HG")
119 installerrs = os.path.join("tests", "install.err")
121 installerrs = os.path.join("tests", "install.err")
120
122
@@ -154,6 +156,8 b' def install_hg():'
154 os.path.join(BINDIR, '_hg.py')))
156 os.path.join(BINDIR, '_hg.py')))
155 f.close()
157 f.close()
156 os.chmod(os.path.join(BINDIR, 'hg'), 0700)
158 os.chmod(os.path.join(BINDIR, 'hg'), 0700)
159 python = '"%s" "%s" -x' % (sys.executable,
160 os.path.join(TESTDIR,'coverage.py'))
157
161
158 def output_coverage():
162 def output_coverage():
159 vlog("# Producing coverage report")
163 vlog("# Producing coverage report")
@@ -163,7 +167,7 b' def output_coverage():'
163 omit += [x for x in sys.path if x != '']
167 omit += [x for x in sys.path if x != '']
164 omit = ','.join(omit)
168 omit = ','.join(omit)
165 os.chdir(PYTHONDIR)
169 os.chdir(PYTHONDIR)
166 cmd = '"%s" "%s" -r "--omit=%s"' % (
170 cmd = '"%s" "%s" -i -r "--omit=%s"' % (
167 sys.executable, os.path.join(TESTDIR, 'coverage.py'), omit)
171 sys.executable, os.path.join(TESTDIR, 'coverage.py'), omit)
168 vlog("# Running: "+cmd)
172 vlog("# Running: "+cmd)
169 os.system(cmd)
173 os.system(cmd)
@@ -171,7 +175,7 b' def output_coverage():'
171 adir = os.path.join(TESTDIR, 'annotated')
175 adir = os.path.join(TESTDIR, 'annotated')
172 if not os.path.isdir(adir):
176 if not os.path.isdir(adir):
173 os.mkdir(adir)
177 os.mkdir(adir)
174 cmd = '"%s" "%s" -a "--directory=%s" "--omit=%s"' % (
178 cmd = '"%s" "%s" -i -a "--directory=%s" "--omit=%s"' % (
175 sys.executable, os.path.join(TESTDIR, 'coverage.py'),
179 sys.executable, os.path.join(TESTDIR, 'coverage.py'),
176 adir, omit)
180 adir, omit)
177 vlog("# Running: "+cmd)
181 vlog("# Running: "+cmd)
@@ -226,6 +230,7 b' def run_one(test):'
226
230
227 err = os.path.join(TESTDIR, test+".err")
231 err = os.path.join(TESTDIR, test+".err")
228 ref = os.path.join(TESTDIR, test+".out")
232 ref = os.path.join(TESTDIR, test+".out")
233 testpath = os.path.join(TESTDIR, test)
229
234
230 if os.path.exists(err):
235 if os.path.exists(err):
231 os.remove(err) # Remove any previous output files
236 os.remove(err) # Remove any previous output files
@@ -235,10 +240,16 b' def run_one(test):'
235 os.mkdir(tmpd)
240 os.mkdir(tmpd)
236 os.chdir(tmpd)
241 os.chdir(tmpd)
237
242
243 try:
244 tf = open(testpath)
245 firstline = tf.readline().rstrip()
246 tf.close()
247 except:
248 firstline = ''
238 lctest = test.lower()
249 lctest = test.lower()
239
250
240 if lctest.endswith('.py'):
251 if lctest.endswith('.py') or firstline == '#!/usr/bin/env python':
241 cmd = '%s "%s"' % (sys.executable, os.path.join(TESTDIR, test))
252 cmd = '%s "%s"' % (python, testpath)
242 elif lctest.endswith('.bat'):
253 elif lctest.endswith('.bat'):
243 # do not run batch scripts on non-windows
254 # do not run batch scripts on non-windows
244 if os.name != 'nt':
255 if os.name != 'nt':
@@ -246,17 +257,17 b' def run_one(test):'
246 return None
257 return None
247 # To reliably get the error code from batch files on WinXP,
258 # To reliably get the error code from batch files on WinXP,
248 # the "cmd /c call" prefix is needed. Grrr
259 # the "cmd /c call" prefix is needed. Grrr
249 cmd = 'cmd /c call "%s"' % (os.path.join(TESTDIR, test))
260 cmd = 'cmd /c call "%s"' % testpath
250 else:
261 else:
251 # do not run shell scripts on windows
262 # do not run shell scripts on windows
252 if os.name == 'nt':
263 if os.name == 'nt':
253 print '\nSkipping %s: shell script' % test
264 print '\nSkipping %s: shell script' % test
254 return None
265 return None
255 # do not try to run non-executable programs
266 # do not try to run non-executable programs
256 if not os.access(os.path.join(TESTDIR, test), os.X_OK):
267 if not os.access(testpath, os.X_OK):
257 print '\nSkipping %s: not executable' % test
268 print '\nSkipping %s: not executable' % test
258 return None
269 return None
259 cmd = '"%s"' % (os.path.join(TESTDIR, test))
270 cmd = '"%s"' % testpath
260
271
261 if options.timeout > 0:
272 if options.timeout > 0:
262 signal.alarm(options.timeout)
273 signal.alarm(options.timeout)
@@ -20,6 +20,9 b' EOF'
20 python dumb.py 2>/dev/null &
20 python dumb.py 2>/dev/null &
21 echo $! >> $DAEMON_PIDS
21 echo $! >> $DAEMON_PIDS
22
22
23 # give the server some time to start running
24 sleep 1
25
23 http_proxy= hg clone http://localhost:20059/foo copy2 2>&1 | \
26 http_proxy= hg clone http://localhost:20059/foo copy2 2>&1 | \
24 sed -e 's/404.*/404/' -e 's/Date:.*/Date:/'
27 sed -e 's/404.*/404/' -e 's/Date:.*/Date:/'
25 echo $?
28 echo $?
@@ -24,6 +24,8 b' options:'
24 -r --rev revision
24 -r --rev revision
25 -I --include include names matching the given patterns
25 -I --include include names matching the given patterns
26 -X --exclude exclude names matching the given patterns
26 -X --exclude exclude names matching the given patterns
27
28 use "hg -v help falabala" to show global options
27 making snapshot of 1 files from rev e27a2475d60a
29 making snapshot of 1 files from rev e27a2475d60a
28 making snapshot of 1 files from rev 5e49ec8d3f05
30 making snapshot of 1 files from rev 5e49ec8d3f05
29 diffing a.e27a2475d60a a.5e49ec8d3f05
31 diffing a.e27a2475d60a a.5e49ec8d3f05
@@ -117,7 +117,7 b' Mercurial Distributed SCM (version xxx)'
117 %% -h/--help
117 %% -h/--help
118 Mercurial Distributed SCM
118 Mercurial Distributed SCM
119
119
120 list of commands (use "hg help -v" to show aliases and global options):
120 list of commands:
121
121
122 add add the specified files on the next commit
122 add add the specified files on the next commit
123 addremove add all new files, delete all missing files
123 addremove add all new files, delete all missing files
@@ -165,9 +165,11 b' list of commands (use "hg help -v" to sh'
165 update update working directory
165 update update working directory
166 verify verify the integrity of the repository
166 verify verify the integrity of the repository
167 version output version and copyright information
167 version output version and copyright information
168
169 use "hg -v help" to show aliases and global options
168 Mercurial Distributed SCM
170 Mercurial Distributed SCM
169
171
170 list of commands (use "hg help -v" to show aliases and global options):
172 list of commands:
171
173
172 add add the specified files on the next commit
174 add add the specified files on the next commit
173 addremove add all new files, delete all missing files
175 addremove add all new files, delete all missing files
@@ -215,4 +217,6 b' list of commands (use "hg help -v" to sh'
215 update update working directory
217 update update working directory
216 verify verify the integrity of the repository
218 verify verify the integrity of the repository
217 version output version and copyright information
219 version output version and copyright information
220
221 use "hg -v help" to show aliases and global options
218 %% not tested: --debugger
222 %% not tested: --debugger
@@ -1,6 +1,6 b''
1 Mercurial Distributed SCM
1 Mercurial Distributed SCM
2
2
3 basic commands (use "hg help" for the full list or option "-v" for details):
3 basic commands:
4
4
5 add add the specified files on the next commit
5 add add the specified files on the next commit
6 annotate show changeset information per file line
6 annotate show changeset information per file line
@@ -19,6 +19,8 b' basic commands (use "hg help" for the fu'
19 serve export the repository via HTTP
19 serve export the repository via HTTP
20 status show changed files in the working directory
20 status show changed files in the working directory
21 update update working directory
21 update update working directory
22
23 use "hg help" for the full list of commands or "hg -v" for details
22 add add the specified files on the next commit
24 add add the specified files on the next commit
23 annotate show changeset information per file line
25 annotate show changeset information per file line
24 clone make a copy of an existing repository
26 clone make a copy of an existing repository
@@ -38,7 +40,7 b' basic commands (use "hg help" for the fu'
38 update update working directory
40 update update working directory
39 Mercurial Distributed SCM
41 Mercurial Distributed SCM
40
42
41 list of commands (use "hg help -v" to show aliases and global options):
43 list of commands:
42
44
43 add add the specified files on the next commit
45 add add the specified files on the next commit
44 addremove add all new files, delete all missing files
46 addremove add all new files, delete all missing files
@@ -86,6 +88,8 b' list of commands (use "hg help -v" to sh'
86 update update working directory
88 update update working directory
87 verify verify the integrity of the repository
89 verify verify the integrity of the repository
88 version output version and copyright information
90 version output version and copyright information
91
92 use "hg -v help" to show aliases and global options
89 add add the specified files on the next commit
93 add add the specified files on the next commit
90 addremove add all new files, delete all missing files
94 addremove add all new files, delete all missing files
91 annotate show changeset information per file line
95 annotate show changeset information per file line
@@ -148,6 +152,8 b' options:'
148 -I --include include names matching the given patterns
152 -I --include include names matching the given patterns
149 -X --exclude exclude names matching the given patterns
153 -X --exclude exclude names matching the given patterns
150 -n --dry-run do not perform actions, just print output
154 -n --dry-run do not perform actions, just print output
155
156 use "hg -v help add" to show global options
151 hg add: option --skjdfks not recognized
157 hg add: option --skjdfks not recognized
152 hg add [OPTION]... [FILE]...
158 hg add [OPTION]... [FILE]...
153
159
@@ -165,6 +171,8 b' options:'
165 -I --include include names matching the given patterns
171 -I --include include names matching the given patterns
166 -X --exclude exclude names matching the given patterns
172 -X --exclude exclude names matching the given patterns
167 -n --dry-run do not perform actions, just print output
173 -n --dry-run do not perform actions, just print output
174
175 use "hg -v help add" to show global options
168 hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...
176 hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...
169
177
170 diff repository (or selected files)
178 diff repository (or selected files)
@@ -199,6 +207,8 b' options:'
199 -B --ignore-blank-lines ignore changes whose lines are all blank
207 -B --ignore-blank-lines ignore changes whose lines are all blank
200 -I --include include names matching the given patterns
208 -I --include include names matching the given patterns
201 -X --exclude exclude names matching the given patterns
209 -X --exclude exclude names matching the given patterns
210
211 use "hg -v help diff" to show global options
202 hg status [OPTION]... [FILE]...
212 hg status [OPTION]... [FILE]...
203
213
204 show changed files in the working directory
214 show changed files in the working directory
@@ -243,13 +253,15 b' options:'
243 --rev show difference from revision
253 --rev show difference from revision
244 -I --include include names matching the given patterns
254 -I --include include names matching the given patterns
245 -X --exclude exclude names matching the given patterns
255 -X --exclude exclude names matching the given patterns
256
257 use "hg -v help status" to show global options
246 hg status [OPTION]... [FILE]...
258 hg status [OPTION]... [FILE]...
247
259
248 show changed files in the working directory
260 show changed files in the working directory
249 hg: unknown command 'foo'
261 hg: unknown command 'foo'
250 Mercurial Distributed SCM
262 Mercurial Distributed SCM
251
263
252 basic commands (use "hg help" for the full list or option "-v" for details):
264 basic commands:
253
265
254 add add the specified files on the next commit
266 add add the specified files on the next commit
255 annotate show changeset information per file line
267 annotate show changeset information per file line
@@ -268,10 +280,12 b' basic commands (use "hg help" for the fu'
268 serve export the repository via HTTP
280 serve export the repository via HTTP
269 status show changed files in the working directory
281 status show changed files in the working directory
270 update update working directory
282 update update working directory
283
284 use "hg help" for the full list of commands or "hg -v" for details
271 hg: unknown command 'skjdfks'
285 hg: unknown command 'skjdfks'
272 Mercurial Distributed SCM
286 Mercurial Distributed SCM
273
287
274 basic commands (use "hg help" for the full list or option "-v" for details):
288 basic commands:
275
289
276 add add the specified files on the next commit
290 add add the specified files on the next commit
277 annotate show changeset information per file line
291 annotate show changeset information per file line
@@ -290,3 +304,5 b' basic commands (use "hg help" for the fu'
290 serve export the repository via HTTP
304 serve export the repository via HTTP
291 status show changed files in the working directory
305 status show changed files in the working directory
292 update update working directory
306 update update working directory
307
308 use "hg help" for the full list of commands or "hg -v" for details
@@ -22,7 +22,7 b' add known patch to applied stack '
22 remove patch from applied stack qpop
22 remove patch from applied stack qpop
23 refresh contents of top applied patch qrefresh
23 refresh contents of top applied patch qrefresh
24
24
25 list of commands (use "hg help -v mq" to show aliases and global options):
25 list of commands:
26
26
27 qapplied print the patches already applied
27 qapplied print the patches already applied
28 qclone clone main and patch repository at same time
28 qclone clone main and patch repository at same time
@@ -48,6 +48,8 b' list of commands (use "hg help -v mq" to'
48 qtop print the name of the current patch
48 qtop print the name of the current patch
49 qunapplied print the patches not yet applied
49 qunapplied print the patches not yet applied
50 strip strip a revision and all later revs on the same branch
50 strip strip a revision and all later revs on the same branch
51
52 use "hg -v help mq" to show aliases and global options
51 adding a
53 adding a
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 adding b/z
55 adding b/z
@@ -3,7 +3,7 b' 0: a'
3 hg: unknown command 'an'
3 hg: unknown command 'an'
4 Mercurial Distributed SCM
4 Mercurial Distributed SCM
5
5
6 basic commands (use "hg help" for the full list or option "-v" for details):
6 basic commands:
7
7
8 add add the specified files on the next commit
8 add add the specified files on the next commit
9 annotate show changeset information per file line
9 annotate show changeset information per file line
@@ -22,6 +22,8 b' basic commands (use "hg help" for the fu'
22 serve export the repository via HTTP
22 serve export the repository via HTTP
23 status show changed files in the working directory
23 status show changed files in the working directory
24 update update working directory
24 update update working directory
25
26 use "hg help" for the full list of commands or "hg -v" for details
25 0: a
27 0: a
26 % should succeed - up is an alias, not an abbreviation
28 % should succeed - up is an alias, not an abbreviation
27 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now