|
@@
-75,6
+75,8
b' def addremove(ui, repo, *pats, **opts):'
|
|
75
|
75
|
option takes a percentage between 0 (disabled) and 100 (files must
|
|
76
|
76
|
be identical) as its parameter. Detecting renamed files this way
|
|
77
|
77
|
can be expensive.
|
|
|
78
|
|
|
|
79
|
Returns 0 if all files are successfully added.
|
|
78
|
80
|
"""
|
|
79
|
81
|
try:
|
|
80
|
82
|
sim = float(opts.get('similarity') or 0)
|
|
@@
-97,6
+99,8
b' def annotate(ui, repo, *pats, **opts):'
|
|
97
|
99
|
it detects as binary. With -a, annotate will annotate the file
|
|
98
|
100
|
anyway, although the results will probably be neither useful
|
|
99
|
101
|
nor desirable.
|
|
|
102
|
|
|
|
103
|
Returns 0 on success.
|
|
100
|
104
|
"""
|
|
101
|
105
|
if opts.get('follow'):
|
|
102
|
106
|
# --follow is deprecated and now just an alias for -f/--file
|
|
@@
-176,6
+180,8
b' def archive(ui, repo, dest, **opts):'
|
|
176
|
180
|
prepended. Use -p/--prefix to specify a format string for the
|
|
177
|
181
|
prefix. The default is the basename of the archive, with suffixes
|
|
178
|
182
|
removed.
|
|
|
183
|
|
|
|
184
|
Returns 0 on success.
|
|
179
|
185
|
'''
|
|
180
|
186
|
|
|
181
|
187
|
ctx = repo[opts.get('rev')]
|
|
@@
-230,6
+236,8
b' def backout(ui, repo, node=None, rev=Non'
|
|
230
|
236
|
The result of this merge is not committed, as with a normal merge.
|
|
231
|
237
|
|
|
232
|
238
|
See :hg:`help dates` for a list of formats valid for -d/--date.
|
|
|
239
|
|
|
|
240
|
Returns 0 on success.
|
|
233
|
241
|
'''
|
|
234
|
242
|
if rev and node:
|
|
235
|
243
|
raise util.Abort(_("please specify just one revision"))
|
|
@@
-323,6
+331,8
b' def bisect(ui, repo, rev=None, extra=Non'
|
|
323
|
331
|
status 0 means good, 125 means to skip the revision, 127
|
|
324
|
332
|
(command not found) will abort the bisection, and any other
|
|
325
|
333
|
non-zero exit status means the revision is bad.
|
|
|
334
|
|
|
|
335
|
Returns 0 on success.
|
|
326
|
336
|
"""
|
|
327
|
337
|
def print_result(nodes, good):
|
|
328
|
338
|
displayer = cmdutil.show_changeset(ui, repo, {})
|
|
@@
-404,7
+414,8
b' def bisect(ui, repo, rev=None, extra=Non'
|
|
404
|
414
|
hg.clean(repo, nodes[0], show_stats=False)
|
|
405
|
415
|
finally:
|
|
406
|
416
|
hbisect.save_state(repo, state)
|
|
407
|
|
return print_result(nodes, good)
|
|
|
417
|
print_result(nodes, good)
|
|
|
418
|
return
|
|
408
|
419
|
|
|
409
|
420
|
# update state
|
|
410
|
421
|
node = repo.lookup(rev or '.')
|
|
@@
-457,6
+468,8
b' def branch(ui, repo, label=None, **opts)'
|
|
457
|
468
|
|
|
458
|
469
|
Use the command :hg:`update` to switch to an existing branch. Use
|
|
459
|
470
|
:hg:`commit --close-branch` to mark this branch as closed.
|
|
|
471
|
|
|
|
472
|
Returns 0 on success.
|
|
460
|
473
|
"""
|
|
461
|
474
|
|
|
462
|
475
|
if opts.get('clean'):
|
|
@@
-485,6
+498,8
b' def branches(ui, repo, active=False, clo'
|
|
485
|
498
|
is considered active if it contains repository heads.
|
|
486
|
499
|
|
|
487
|
500
|
Use the command :hg:`update` to switch to an existing branch.
|
|
|
501
|
|
|
|
502
|
Returns 0.
|
|
488
|
503
|
"""
|
|
489
|
504
|
|
|
490
|
505
|
hexfunc = ui.debugflag and hex or short
|
|
@@
-538,6
+553,8
b' def bundle(ui, repo, fname, dest=None, *'
|
|
538
|
553
|
|
|
539
|
554
|
Applying bundles preserves all changeset contents including
|
|
540
|
555
|
permissions, copy/rename information, and revision history.
|
|
|
556
|
|
|
|
557
|
Returns 0 on success, 1 if no changes found.
|
|
541
|
558
|
"""
|
|
542
|
559
|
revs = opts.get('rev') or None
|
|
543
|
560
|
if revs:
|
|
@@
-583,7
+600,7
b' def bundle(ui, repo, fname, dest=None, *'
|
|
583
|
600
|
|
|
584
|
601
|
if not o:
|
|
585
|
602
|
ui.status(_("no changes found\n"))
|
|
586
|
|
return
|
|
|
603
|
return 1
|
|
587
|
604
|
|
|
588
|
605
|
if revs:
|
|
589
|
606
|
cg = repo.changegroupsubset(o, revs, 'bundle')
|
|
@@
-612,6
+629,8
b' def cat(ui, repo, file1, *pats, **opts):'
|
|
612
|
629
|
:``%s``: basename of file being printed
|
|
613
|
630
|
:``%d``: dirname of file being printed, or '.' if in repository root
|
|
614
|
631
|
:``%p``: root-relative path name of file being printed
|
|
|
632
|
|
|
|
633
|
Returns 0 on success.
|
|
615
|
634
|
"""
|
|
616
|
635
|
ctx = repo[opts.get('rev')]
|
|
617
|
636
|
err = 1
|
|
@@
-686,16
+705,20
b' def clone(ui, source, dest=None, **opts)'
|
|
686
|
705
|
f) the tipmost head specified with the url#branch source syntax
|
|
687
|
706
|
g) the tipmost head of the default branch
|
|
688
|
707
|
h) tip
|
|
|
708
|
|
|
|
709
|
Returns 0 on success.
|
|
689
|
710
|
"""
|
|
690
|
711
|
if opts.get('noupdate') and opts.get('updaterev'):
|
|
691
|
712
|
raise util.Abort(_("cannot specify both --noupdate and --updaterev"))
|
|
692
|
713
|
|
|
693
|
|
hg.clone(cmdutil.remoteui(ui, opts), source, dest,
|
|
694
|
|
pull=opts.get('pull'),
|
|
695
|
|
stream=opts.get('uncompressed'),
|
|
696
|
|
rev=opts.get('rev'),
|
|
697
|
|
update=opts.get('updaterev') or not opts.get('noupdate'),
|
|
698
|
|
branch=opts.get('branch'))
|
|
|
714
|
r = hg.clone(cmdutil.remoteui(ui, opts), source, dest,
|
|
|
715
|
pull=opts.get('pull'),
|
|
|
716
|
stream=opts.get('uncompressed'),
|
|
|
717
|
rev=opts.get('rev'),
|
|
|
718
|
update=opts.get('updaterev') or not opts.get('noupdate'),
|
|
|
719
|
branch=opts.get('branch'))
|
|
|
720
|
|
|
|
721
|
return r is None
|
|
699
|
722
|
|
|
700
|
723
|
def commit(ui, repo, *pats, **opts):
|
|
701
|
724
|
"""commit the specified files or all outstanding changes
|
|
@@
-714,6
+737,8
b' def commit(ui, repo, *pats, **opts):'
|
|
714
|
737
|
started to prompt you for a message.
|
|
715
|
738
|
|
|
716
|
739
|
See :hg:`help dates` for a list of formats valid for -d/--date.
|
|
|
740
|
|
|
|
741
|
Returns 0 on success, 1 if nothing changed.
|
|
717
|
742
|
"""
|
|
718
|
743
|
extra = {}
|
|
719
|
744
|
if opts.get('close_branch'):
|
|
@@
-736,7
+761,7
b' def commit(ui, repo, *pats, **opts):'
|
|
736
|
761
|
node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
|
|
737
|
762
|
if not node:
|
|
738
|
763
|
ui.status(_("nothing changed\n"))
|
|
739
|
|
return
|
|
|
764
|
return 1
|
|
740
|
765
|
|
|
741
|
766
|
ctx = repo[node]
|
|
742
|
767
|
parents = ctx.parents()
|
|
@@
-767,6
+792,8
b' def copy(ui, repo, *pats, **opts):'
|
|
767
|
792
|
|
|
768
|
793
|
This command takes effect with the next commit. To undo a copy
|
|
769
|
794
|
before that, see hg revert.
|
|
|
795
|
|
|
|
796
|
Returns 0 on success, 1 if errors are encountered.
|
|
770
|
797
|
"""
|
|
771
|
798
|
wlock = repo.wlock(False)
|
|
772
|
799
|
try:
|
|
@@
-793,6
+820,7
b' def debugancestor(ui, repo, *args):'
|
|
793
|
820
|
ui.write("%d:%s\n" % (r.rev(a), hex(a)))
|
|
794
|
821
|
|
|
795
|
822
|
def debugcommands(ui, cmd='', *args):
|
|
|
823
|
"""list all available commands and options"""
|
|
796
|
824
|
for cmd, vals in sorted(table.iteritems()):
|
|
797
|
825
|
cmd = cmd.split('|')[0].strip('^')
|
|
798
|
826
|
opts = ', '.join([i[1] for i in vals[1]])
|
|
@@
-823,6
+851,7
b" def debugcomplete(ui, cmd='', **opts):"
|
|
823
|
851
|
ui.write("%s\n" % "\n".join(sorted(cmdlist)))
|
|
824
|
852
|
|
|
825
|
853
|
def debugfsinfo(ui, path = "."):
|
|
|
854
|
"""show information detected about current filesystem"""
|
|
826
|
855
|
open('.debugfsinfo', 'w').write('')
|
|
827
|
856
|
ui.write('exec: %s\n' % (util.checkexec(path) and 'yes' or 'no'))
|
|
828
|
857
|
ui.write('symlink: %s\n' % (util.checklink(path) and 'yes' or 'no'))
|
|
@@
-879,6
+908,8
b' def showconfig(ui, repo, *values, **opts'
|
|
879
|
908
|
|
|
880
|
909
|
With --debug, the source (filename and line number) is printed
|
|
881
|
910
|
for each config item.
|
|
|
911
|
|
|
|
912
|
Returns 0 on success.
|
|
882
|
913
|
"""
|
|
883
|
914
|
|
|
884
|
915
|
for f in util.rcpath():
|
|
@@
-909,6
+940,8
b' def debugsetparents(ui, repo, rev1, rev2'
|
|
909
|
940
|
|
|
910
|
941
|
This is useful for writing repository conversion tools, but should
|
|
911
|
942
|
be used with care.
|
|
|
943
|
|
|
|
944
|
Returns 0 on success.
|
|
912
|
945
|
"""
|
|
913
|
946
|
|
|
914
|
947
|
if not rev2:
|
|
@@
-1000,7
+1033,10
b' def debugindexdot(ui, file_):'
|
|
1000
|
1033
|
ui.write("}\n")
|
|
1001
|
1034
|
|
|
1002
|
1035
|
def debuginstall(ui):
|
|
1003
|
|
'''test Mercurial installation'''
|
|
|
1036
|
'''test Mercurial installation
|
|
|
1037
|
|
|
|
1038
|
Returns 0 on success.
|
|
|
1039
|
'''
|
|
1004
|
1040
|
|
|
1005
|
1041
|
def writetemp(contents):
|
|
1006
|
1042
|
(fd, name) = tempfile.mkstemp(prefix="hg-debuginstall-")
|
|
@@
-1161,6
+1197,8
b' def diff(ui, repo, *pats, **opts):'
|
|
1161
|
1197
|
|
|
1162
|
1198
|
Use the -g/--git option to generate diffs in the git extended diff
|
|
1163
|
1199
|
format. For more information, read :hg:`help diffs`.
|
|
|
1200
|
|
|
|
1201
|
Returns 0 on success.
|
|
1164
|
1202
|
"""
|
|
1165
|
1203
|
|
|
1166
|
1204
|
revs = opts.get('rev')
|
|
@@
-1218,6
+1256,8
b' def export(ui, repo, *changesets, **opts'
|
|
1218
|
1256
|
|
|
1219
|
1257
|
With the --switch-parent option, the diff will be against the
|
|
1220
|
1258
|
second parent. It can be useful to review a merge.
|
|
|
1259
|
|
|
|
1260
|
Returns 0 on success.
|
|
1221
|
1261
|
"""
|
|
1222
|
1262
|
changesets += tuple(opts.get('rev', []))
|
|
1223
|
1263
|
if not changesets:
|
|
@@
-1242,6
+1282,8
b' def forget(ui, repo, *pats, **opts):'
|
|
1242
|
1282
|
working directory.
|
|
1243
|
1283
|
|
|
1244
|
1284
|
To undo a forget before the next commit, see hg add.
|
|
|
1285
|
|
|
|
1286
|
Returns 0 on success.
|
|
1245
|
1287
|
"""
|
|
1246
|
1288
|
|
|
1247
|
1289
|
if not pats:
|
|
@@
-1250,17
+1292,20
b' def forget(ui, repo, *pats, **opts):'
|
|
1250
|
1292
|
m = cmdutil.match(repo, pats, opts)
|
|
1251
|
1293
|
s = repo.status(match=m, clean=True)
|
|
1252
|
1294
|
forget = sorted(s[0] + s[1] + s[3] + s[6])
|
|
|
1295
|
errs = 0
|
|
1253
|
1296
|
|
|
1254
|
1297
|
for f in m.files():
|
|
1255
|
1298
|
if f not in repo.dirstate and not os.path.isdir(m.rel(f)):
|
|
1256
|
1299
|
ui.warn(_('not removing %s: file is already untracked\n')
|
|
1257
|
1300
|
% m.rel(f))
|
|
|
1301
|
errs = 1
|
|
1258
|
1302
|
|
|
1259
|
1303
|
for f in forget:
|
|
1260
|
1304
|
if ui.verbose or not m.exact(f):
|
|
1261
|
1305
|
ui.status(_('removing %s\n') % m.rel(f))
|
|
1262
|
1306
|
|
|
1263
|
1307
|
repo.remove(forget, unlink=False)
|
|
|
1308
|
return errs
|
|
1264
|
1309
|
|
|
1265
|
1310
|
def grep(ui, repo, pattern, *pats, **opts):
|
|
1266
|
1311
|
"""search for a pattern in specified files and revisions
|
|
@@
-1277,6
+1322,8
b' def grep(ui, repo, pattern, *pats, **opt'
|
|
1277
|
1322
|
that contains a change in match status ("-" for a match that
|
|
1278
|
1323
|
becomes a non-match, or "+" for a non-match that becomes a match),
|
|
1279
|
1324
|
use the --all flag.
|
|
|
1325
|
|
|
|
1326
|
Returns 0 if a match is found, 1 otherwise.
|
|
1280
|
1327
|
"""
|
|
1281
|
1328
|
reflags = 0
|
|
1282
|
1329
|
if opts.get('ignore_case'):
|
|
@@
-1285,7
+1332,7
b' def grep(ui, repo, pattern, *pats, **opt'
|
|
1285
|
1332
|
regexp = re.compile(pattern, reflags)
|
|
1286
|
1333
|
except Exception, inst:
|
|
1287
|
1334
|
ui.warn(_("grep: invalid match pattern: %s\n") % inst)
|
|
1288
|
|
return None
|
|
|
1335
|
return 1
|
|
1289
|
1336
|
sep, eol = ':', '\n'
|
|
1290
|
1337
|
if opts.get('print0'):
|
|
1291
|
1338
|
sep = eol = '\0'
|
|
@@
-1443,6
+1490,8
b' def grep(ui, repo, pattern, *pats, **opt'
|
|
1443
|
1490
|
del matches[rev]
|
|
1444
|
1491
|
del revfiles[rev]
|
|
1445
|
1492
|
|
|
|
1493
|
return not found
|
|
|
1494
|
|
|
1446
|
1495
|
def heads(ui, repo, *branchrevs, **opts):
|
|
1447
|
1496
|
"""show current repository heads or show branch heads
|
|
1448
|
1497
|
|
|
@@
-1464,6
+1513,8
b' def heads(ui, repo, *branchrevs, **opts)'
|
|
1464
|
1513
|
|
|
1465
|
1514
|
If -t/--topo is specified, named branch mechanics will be ignored and only
|
|
1466
|
1515
|
changesets without children will be shown.
|
|
|
1516
|
|
|
|
1517
|
Returns 0 if matching heads are found, 1 if not.
|
|
1467
|
1518
|
"""
|
|
1468
|
1519
|
|
|
1469
|
1520
|
if opts.get('rev'):
|
|
@@
-1521,7
+1572,10
b' def help_(ui, name=None, with_version=Fa'
|
|
1521
|
1572
|
With no arguments, print a list of commands with short help messages.
|
|
1522
|
1573
|
|
|
1523
|
1574
|
Given a topic, extension, or command name, print help for that
|
|
1524
|
|
topic."""
|
|
|
1575
|
topic.
|
|
|
1576
|
|
|
|
1577
|
Returns 0 if successful.
|
|
|
1578
|
"""
|
|
1525
|
1579
|
option_lists = []
|
|
1526
|
1580
|
textwidth = util.termwidth() - 2
|
|
1527
|
1581
|
|
|
@@
-1779,6
+1833,8
b' def identify(ui, repo, source=None,'
|
|
1779
|
1833
|
parent hash identifiers, followed by a "+" if there are
|
|
1780
|
1834
|
uncommitted changes in the working directory, a list of tags for
|
|
1781
|
1835
|
this revision and a branch name for non-default branches.
|
|
|
1836
|
|
|
|
1837
|
Returns 0 if successful.
|
|
1782
|
1838
|
"""
|
|
1783
|
1839
|
|
|
1784
|
1840
|
if not repo and not source:
|
|
@@
-1874,6
+1930,8
b' def import_(ui, repo, patch1, *patches, '
|
|
1874
|
1930
|
To read a patch from standard input, use "-" as the patch name. If
|
|
1875
|
1931
|
a URL is specified, the patch will be downloaded from it.
|
|
1876
|
1932
|
See :hg:`help dates` for a list of formats valid for -d/--date.
|
|
|
1933
|
|
|
|
1934
|
Returns 0 on success.
|
|
1877
|
1935
|
"""
|
|
1878
|
1936
|
patches = (patch1,) + patches
|
|
1879
|
1937
|
|
|
@@
-2007,6
+2065,8
b' def incoming(ui, repo, source="default",'
|
|
2007
|
2065
|
changesets twice if the incoming is followed by a pull.
|
|
2008
|
2066
|
|
|
2009
|
2067
|
See pull for valid source format details.
|
|
|
2068
|
|
|
|
2069
|
Returns 0 if there are incoming changes, 1 otherwise.
|
|
2010
|
2070
|
"""
|
|
2011
|
2071
|
limit = cmdutil.loglimit(opts)
|
|
2012
|
2072
|
source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
|
|
@@
-2077,6
+2137,8
b' def init(ui, dest=".", **opts):'
|
|
2077
|
2137
|
|
|
2078
|
2138
|
It is possible to specify an ``ssh://`` URL as the destination.
|
|
2079
|
2139
|
See :hg:`help urls` for more information.
|
|
|
2140
|
|
|
|
2141
|
Returns 0 on success.
|
|
2080
|
2142
|
"""
|
|
2081
|
2143
|
hg.repository(cmdutil.remoteui(ui, opts), dest, create=1)
|
|
2082
|
2144
|
|
|
@@
-2097,6
+2159,8
b' def locate(ui, repo, *pats, **opts):'
|
|
2097
|
2159
|
command, use the -0 option to both this command and "xargs". This
|
|
2098
|
2160
|
will avoid the problem of "xargs" treating single filenames that
|
|
2099
|
2161
|
contain whitespace as multiple filenames.
|
|
|
2162
|
|
|
|
2163
|
Returns 0 if a match is found, 1 otherwise.
|
|
2100
|
2164
|
"""
|
|
2101
|
2165
|
end = opts.get('print0') and '\0' or '\n'
|
|
2102
|
2166
|
rev = opts.get('rev') or None
|
|
@@
-2142,6
+2206,8
b' def log(ui, repo, *pats, **opts):'
|
|
2142
|
2206
|
changesets, as it will only compare the merge changeset against
|
|
2143
|
2207
|
its first parent. Also, only files different from BOTH parents
|
|
2144
|
2208
|
will appear in files:.
|
|
|
2209
|
|
|
|
2210
|
Returns 0 on success.
|
|
2145
|
2211
|
"""
|
|
2146
|
2212
|
|
|
2147
|
2213
|
matchfn = cmdutil.match(repo, pats, opts)
|
|
@@
-2210,6
+2276,8
b' def manifest(ui, repo, node=None, rev=No'
|
|
2210
|
2276
|
|
|
2211
|
2277
|
With -v, print file permissions, symlink and executable bits.
|
|
2212
|
2278
|
With --debug, print file revision hashes.
|
|
|
2279
|
|
|
|
2280
|
Returns 0 on success.
|
|
2213
|
2281
|
"""
|
|
2214
|
2282
|
|
|
2215
|
2283
|
if rev and node:
|
|
@@
-2242,6
+2310,8
b' def merge(ui, repo, node=None, **opts):'
|
|
2242
|
2310
|
head revision, and the current branch contains exactly one other
|
|
2243
|
2311
|
head, the other head is merged with by default. Otherwise, an
|
|
2244
|
2312
|
explicit revision with which to merge with must be provided.
|
|
|
2313
|
|
|
|
2314
|
Returns 0 on success, 1 if there are unresolved files.
|
|
2245
|
2315
|
"""
|
|
2246
|
2316
|
|
|
2247
|
2317
|
if opts.get('rev') and node:
|
|
@@
-2298,6
+2368,8
b' def outgoing(ui, repo, dest=None, **opts'
|
|
2298
|
2368
|
be pushed if a push was requested.
|
|
2299
|
2369
|
|
|
2300
|
2370
|
See pull for details of valid destination formats.
|
|
|
2371
|
|
|
|
2372
|
Returns 0 if there are outgoing changes, 1 otherwise.
|
|
2301
|
2373
|
"""
|
|
2302
|
2374
|
limit = cmdutil.loglimit(opts)
|
|
2303
|
2375
|
dest = ui.expandpath(dest or 'default-push', dest or 'default')
|
|
@@
-2335,6
+2407,8
b' def parents(ui, repo, file_=None, **opts'
|
|
2335
|
2407
|
If a file argument is given, the revision in which the file was
|
|
2336
|
2408
|
last changed (before the working directory revision or the
|
|
2337
|
2409
|
argument to --rev if given) is printed.
|
|
|
2410
|
|
|
|
2411
|
Returns 0 on success.
|
|
2338
|
2412
|
"""
|
|
2339
|
2413
|
rev = opts.get('rev')
|
|
2340
|
2414
|
if rev:
|
|
@@
-2432,6
+2506,8
b' def pull(ui, repo, source="default", **o'
|
|
2432
|
2506
|
|
|
2433
|
2507
|
If SOURCE is omitted, the 'default' path will be used.
|
|
2434
|
2508
|
See :hg:`help urls` for more information.
|
|
|
2509
|
|
|
|
2510
|
Returns 0 on success, 1 if an update had unresolved files.
|
|
2435
|
2511
|
"""
|
|
2436
|
2512
|
source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
|
|
2437
|
2513
|
other = hg.repository(cmdutil.remoteui(repo, opts), source)
|
|
@@
-2469,6
+2545,8
b' def push(ui, repo, dest=None, **opts):'
|
|
2469
|
2545
|
|
|
2470
|
2546
|
Please see :hg:`help urls` for important details about ``ssh://``
|
|
2471
|
2547
|
URLs. If DESTINATION is omitted, a default path will be used.
|
|
|
2548
|
|
|
|
2549
|
Returns 0 if push was successful, 1 if nothing to push.
|
|
2472
|
2550
|
"""
|
|
2473
|
2551
|
dest = ui.expandpath(dest or 'default-push', dest or 'default')
|
|
2474
|
2552
|
dest, branches = hg.parseurl(dest, opts.get('branch'))
|
|
@@
-2496,6
+2574,8
b' def recover(ui, repo):'
|
|
2496
|
2574
|
This command tries to fix the repository status after an
|
|
2497
|
2575
|
interrupted operation. It should only be necessary when Mercurial
|
|
2498
|
2576
|
suggests it.
|
|
|
2577
|
|
|
|
2578
|
Returns 0 if successful, 1 if nothing to recover or verify fails.
|
|
2499
|
2579
|
"""
|
|
2500
|
2580
|
if repo.recover():
|
|
2501
|
2581
|
return hg.verify(repo)
|
|
@@
-2526,8
+2606,11
b' def remove(ui, repo, *pats, **opts):'
|
|
2526
|
2606
|
|
|
2527
|
2607
|
This command schedules the files to be removed at the next commit.
|
|
2528
|
2608
|
To undo a remove before that, see hg revert.
|
|
|
2609
|
|
|
|
2610
|
Returns 0 on success, 1 if any warnings encountered.
|
|
2529
|
2611
|
"""
|
|
2530
|
2612
|
|
|
|
2613
|
ret = 0
|
|
2531
|
2614
|
after, force = opts.get('after'), opts.get('force')
|
|
2532
|
2615
|
if not pats and not after:
|
|
2533
|
2616
|
raise util.Abort(_('no files specified'))
|
|
@@
-2539,11
+2622,13
b' def remove(ui, repo, *pats, **opts):'
|
|
2539
|
2622
|
for f in m.files():
|
|
2540
|
2623
|
if f not in repo.dirstate and not os.path.isdir(m.rel(f)):
|
|
2541
|
2624
|
ui.warn(_('not removing %s: file is untracked\n') % m.rel(f))
|
|
|
2625
|
ret = 1
|
|
2542
|
2626
|
|
|
2543
|
2627
|
def warn(files, reason):
|
|
2544
|
2628
|
for f in files:
|
|
2545
|
2629
|
ui.warn(_('not removing %s: file %s (use -f to force removal)\n')
|
|
2546
|
2630
|
% (m.rel(f), reason))
|
|
|
2631
|
ret = 1
|
|
2547
|
2632
|
|
|
2548
|
2633
|
if force:
|
|
2549
|
2634
|
remove, forget = modified + deleted + clean, added
|
|
@@
-2561,6
+2646,7
b' def remove(ui, repo, *pats, **opts):'
|
|
2561
|
2646
|
|
|
2562
|
2647
|
repo.forget(forget)
|
|
2563
|
2648
|
repo.remove(remove, unlink=not after)
|
|
|
2649
|
return ret
|
|
2564
|
2650
|
|
|
2565
|
2651
|
def rename(ui, repo, *pats, **opts):
|
|
2566
|
2652
|
"""rename files; equivalent of copy + remove
|
|
@@
-2575,6
+2661,8
b' def rename(ui, repo, *pats, **opts):'
|
|
2575
|
2661
|
|
|
2576
|
2662
|
This command takes effect at the next commit. To undo a rename
|
|
2577
|
2663
|
before that, see hg revert.
|
|
|
2664
|
|
|
|
2665
|
Returns 0 on success, 1 if errors are encountered.
|
|
2578
|
2666
|
"""
|
|
2579
|
2667
|
wlock = repo.wlock(False)
|
|
2580
|
2668
|
try:
|
|
@@
-2608,6
+2696,8
b' def resolve(ui, repo, *pats, **opts):'
|
|
2608
|
2696
|
Note that Mercurial will not let you commit files with unresolved merge
|
|
2609
|
2697
|
conflicts. You must use ``hg resolve -m ...`` before you can commit
|
|
2610
|
2698
|
after a conflicting merge.
|
|
|
2699
|
|
|
|
2700
|
Returns 0 on success, 1 if any files fail a resolve attempt.
|
|
2611
|
2701
|
"""
|
|
2612
|
2702
|
|
|
2613
|
2703
|
all, mark, unmark, show, nostatus = \
|
|
@@
-2623,6
+2713,7
b' def resolve(ui, repo, *pats, **opts):'
|
|
2623
|
2713
|
|
|
2624
|
2714
|
ms = mergemod.mergestate(repo)
|
|
2625
|
2715
|
m = cmdutil.match(repo, pats, opts)
|
|
|
2716
|
ret = 0
|
|
2626
|
2717
|
|
|
2627
|
2718
|
for f in ms:
|
|
2628
|
2719
|
if m(f):
|
|
@@
-2646,10
+2737,12
b' def resolve(ui, repo, *pats, **opts):'
|
|
2646
|
2737
|
util.copyfile(a, a + ".resolve")
|
|
2647
|
2738
|
|
|
2648
|
2739
|
# resolve file
|
|
2649
|
|
ms.resolve(f, wctx, mctx)
|
|
|
2740
|
if ms.resolve(f, wctx, mctx):
|
|
|
2741
|
ret = 1
|
|
2650
|
2742
|
|
|
2651
|
2743
|
# replace filemerge's .orig file with our resolve file
|
|
2652
|
2744
|
util.rename(a + ".resolve", a + ".orig")
|
|
|
2745
|
return ret
|
|
2653
|
2746
|
|
|
2654
|
2747
|
def revert(ui, repo, *pats, **opts):
|
|
2655
|
2748
|
"""restore individual files or directories to an earlier state
|
|
@@
-2683,6
+2776,8
b' def revert(ui, repo, *pats, **opts):'
|
|
2683
|
2776
|
|
|
2684
|
2777
|
Modified files are saved with a .orig suffix before reverting.
|
|
2685
|
2778
|
To disable these backups, use --no-backup.
|
|
|
2779
|
|
|
|
2780
|
Returns 0 on success.
|
|
2686
|
2781
|
"""
|
|
2687
|
2782
|
|
|
2688
|
2783
|
if opts["date"]:
|
|
@@
-2895,13
+2990,17
b' def rollback(ui, repo, **opts):'
|
|
2895
|
2990
|
the changes). Furthermore, a race is possible with readers of the
|
|
2896
|
2991
|
repository; for example an in-progress pull from the repository
|
|
2897
|
2992
|
may fail if a rollback is performed.
|
|
|
2993
|
|
|
|
2994
|
Returns 0 on success, 1 if no rollback data is available.
|
|
2898
|
2995
|
"""
|
|
2899
|
|
repo.rollback(opts.get('dry_run'))
|
|
|
2996
|
return repo.rollback(opts.get('dry_run'))
|
|
2900
|
2997
|
|
|
2901
|
2998
|
def root(ui, repo):
|
|
2902
|
2999
|
"""print the root (top) of the current working directory
|
|
2903
|
3000
|
|
|
2904
|
3001
|
Print the root directory of the current repository.
|
|
|
3002
|
|
|
|
3003
|
Returns 0 on success.
|
|
2905
|
3004
|
"""
|
|
2906
|
3005
|
ui.write(repo.root + "\n")
|
|
2907
|
3006
|
|
|
@@
-2926,6
+3025,8
b' def serve(ui, repo, **opts):'
|
|
2926
|
3025
|
To have the server choose a free port number to listen on, specify
|
|
2927
|
3026
|
a port number of 0; in this case, the server will print the port
|
|
2928
|
3027
|
number it uses.
|
|
|
3028
|
|
|
|
3029
|
Returns 0 on success.
|
|
2929
|
3030
|
"""
|
|
2930
|
3031
|
|
|
2931
|
3032
|
if opts["stdio"]:
|
|
@@
-3032,6
+3133,8
b' def status(ui, repo, *pats, **opts):'
|
|
3032
|
3133
|
? = not tracked
|
|
3033
|
3134
|
I = ignored
|
|
3034
|
3135
|
= origin of the previous file listed as A (added)
|
|
|
3136
|
|
|
|
3137
|
Returns 0 on success.
|
|
3035
|
3138
|
"""
|
|
3036
|
3139
|
|
|
3037
|
3140
|
revs = opts.get('rev')
|
|
@@
-3095,6
+3198,8
b' def summary(ui, repo, **opts):'
|
|
3095
|
3198
|
|
|
3096
|
3199
|
With the --remote option, this will check the default paths for
|
|
3097
|
3200
|
incoming and outgoing changes. This can be time-consuming.
|
|
|
3201
|
|
|
|
3202
|
Returns 0 on success.
|
|
3098
|
3203
|
"""
|
|
3099
|
3204
|
|
|
3100
|
3205
|
ctx = repo[None]
|
|
@@
-3239,6
+3344,8
b' def tag(ui, repo, name1, *names, **opts)'
|
|
3239
|
3344
|
|
|
3240
|
3345
|
Since tag names have priority over branch names during revision
|
|
3241
|
3346
|
lookup, using an existing branch name as a tag name is discouraged.
|
|
|
3347
|
|
|
|
3348
|
Returns 0 on success.
|
|
3242
|
3349
|
"""
|
|
3243
|
3350
|
|
|
3244
|
3351
|
rev_ = "."
|
|
@@
-3293,6
+3400,8
b' def tags(ui, repo):'
|
|
3293
|
3400
|
|
|
3294
|
3401
|
This lists both regular and local tags. When the -v/--verbose
|
|
3295
|
3402
|
switch is used, a third column "local" is printed for local tags.
|
|
|
3403
|
|
|
|
3404
|
Returns 0 on success.
|
|
3296
|
3405
|
"""
|
|
3297
|
3406
|
|
|
3298
|
3407
|
hexfunc = ui.debugflag and hex or short
|
|
@@
-3328,6
+3437,8
b' def tip(ui, repo, **opts):'
|
|
3328
|
3437
|
you have just pulled changes from another repository, the tip of
|
|
3329
|
3438
|
that repository becomes the current tip. The "tip" tag is special
|
|
3330
|
3439
|
and cannot be renamed or assigned to a different changeset.
|
|
|
3440
|
|
|
|
3441
|
Returns 0 on success.
|
|
3331
|
3442
|
"""
|
|
3332
|
3443
|
displayer = cmdutil.show_changeset(ui, repo, opts)
|
|
3333
|
3444
|
displayer.show(repo[len(repo) - 1])
|
|
@@
-3338,6
+3449,8
b' def unbundle(ui, repo, fname1, *fnames, '
|
|
3338
|
3449
|
|
|
3339
|
3450
|
Apply one or more compressed changegroup files generated by the
|
|
3340
|
3451
|
bundle command.
|
|
|
3452
|
|
|
|
3453
|
Returns 0 on success, 1 if an update has unresolved files.
|
|
3341
|
3454
|
"""
|
|
3342
|
3455
|
fnames = (fname1,) + fnames
|
|
3343
|
3456
|
|
|
@@
-3386,6
+3499,8
b' def update(ui, repo, node=None, rev=None'
|
|
3386
|
3499
|
If you want to update just one file to an older changeset, use :hg:`revert`.
|
|
3387
|
3500
|
|
|
3388
|
3501
|
See :hg:`help dates` for a list of formats valid for -d/--date.
|
|
|
3502
|
|
|
|
3503
|
Returns 0 on success, 1 if there are unresolved files.
|
|
3389
|
3504
|
"""
|
|
3390
|
3505
|
if rev and node:
|
|
3391
|
3506
|
raise util.Abort(_("please specify just one revision"))
|
|
@@
-3421,6
+3536,8
b' def verify(ui, repo):'
|
|
3421
|
3536
|
integrity, validating the hashes and checksums of each entry in
|
|
3422
|
3537
|
the changelog, manifest, and tracked files, as well as the
|
|
3423
|
3538
|
integrity of their crosslinks and indices.
|
|
|
3539
|
|
|
|
3540
|
Returns 0 on success, 1 if errors are encountered.
|
|
3424
|
3541
|
"""
|
|
3425
|
3542
|
return hg.verify(repo)
|
|
3426
|
3543
|
|