Show More
@@ -771,7 +771,7 b' class queue(object):' | |||||
771 | if opts.get('rev'): |
|
771 | if opts.get('rev'): | |
772 | if not self.applied: |
|
772 | if not self.applied: | |
773 | raise util.Abort(_('no patches applied')) |
|
773 | raise util.Abort(_('no patches applied')) | |
774 |
revs = cmdutil.revrange(repo, opts |
|
774 | revs = cmdutil.revrange(repo, opts.get('rev')) | |
775 | if len(revs) > 1 and revs[0] > revs[1]: |
|
775 | if len(revs) > 1 and revs[0] > revs[1]: | |
776 | revs.reverse() |
|
776 | revs.reverse() | |
777 | revpatches = self._revpatches(repo, revs) |
|
777 | revpatches = self._revpatches(repo, revs) | |
@@ -1831,9 +1831,9 b' def qimport(ui, repo, *filename, **opts)' | |||||
1831 | """ |
|
1831 | """ | |
1832 | q = repo.mq |
|
1832 | q = repo.mq | |
1833 | try: |
|
1833 | try: | |
1834 |
q.qimport(repo, filename, patchname=opts |
|
1834 | q.qimport(repo, filename, patchname=opts.get('name'), | |
1835 |
existing=opts |
|
1835 | existing=opts.get('existing'), force=opts.get('force'), | |
1836 |
git=opts |
|
1836 | rev=opts.get('rev'), git=opts.get('git')) | |
1837 | finally: |
|
1837 | finally: | |
1838 | q.save_dirty() |
|
1838 | q.save_dirty() | |
1839 |
|
1839 | |||
@@ -1876,7 +1876,7 b' def init(ui, repo, **opts):' | |||||
1876 |
|
1876 | |||
1877 | This command is deprecated. Without -c, it's implied by other relevant |
|
1877 | This command is deprecated. Without -c, it's implied by other relevant | |
1878 | commands. With -c, use :hg:`init --mq` instead.""" |
|
1878 | commands. With -c, use :hg:`init --mq` instead.""" | |
1879 |
return qinit(ui, repo, create=opts |
|
1879 | return qinit(ui, repo, create=opts.get('create_repo')) | |
1880 |
|
1880 | |||
1881 | def clone(ui, source, dest=None, **opts): |
|
1881 | def clone(ui, source, dest=None, **opts): | |
1882 | '''clone main and patch repository at same time |
|
1882 | '''clone main and patch repository at same time | |
@@ -1901,8 +1901,8 b' def clone(ui, source, dest=None, **opts)' | |||||
1901 | if dest is None: |
|
1901 | if dest is None: | |
1902 | dest = hg.defaultdest(source) |
|
1902 | dest = hg.defaultdest(source) | |
1903 | sr = hg.repository(hg.remoteui(ui, opts), ui.expandpath(source)) |
|
1903 | sr = hg.repository(hg.remoteui(ui, opts), ui.expandpath(source)) | |
1904 |
if opts |
|
1904 | if opts.get('patches'): | |
1905 |
patchespath = ui.expandpath(opts |
|
1905 | patchespath = ui.expandpath(opts.get('patches')) | |
1906 | else: |
|
1906 | else: | |
1907 | patchespath = patchdir(sr) |
|
1907 | patchespath = patchdir(sr) | |
1908 | try: |
|
1908 | try: | |
@@ -1925,20 +1925,20 b' def clone(ui, source, dest=None, **opts)' | |||||
1925 | pass |
|
1925 | pass | |
1926 | ui.note(_('cloning main repository\n')) |
|
1926 | ui.note(_('cloning main repository\n')) | |
1927 | sr, dr = hg.clone(ui, sr.url(), dest, |
|
1927 | sr, dr = hg.clone(ui, sr.url(), dest, | |
1928 |
pull=opts |
|
1928 | pull=opts.get('pull'), | |
1929 | rev=destrev, |
|
1929 | rev=destrev, | |
1930 | update=False, |
|
1930 | update=False, | |
1931 |
stream=opts |
|
1931 | stream=opts.get('uncompressed')) | |
1932 | ui.note(_('cloning patch repository\n')) |
|
1932 | ui.note(_('cloning patch repository\n')) | |
1933 |
hg.clone(ui, opts |
|
1933 | hg.clone(ui, opts.get('patches') or patchdir(sr), patchdir(dr), | |
1934 |
pull=opts |
|
1934 | pull=opts.get('pull'), update=not opts.get('noupdate'), | |
1935 |
stream=opts |
|
1935 | stream=opts.get('uncompressed')) | |
1936 | if dr.local(): |
|
1936 | if dr.local(): | |
1937 | if qbase: |
|
1937 | if qbase: | |
1938 | ui.note(_('stripping applied patches from destination ' |
|
1938 | ui.note(_('stripping applied patches from destination ' | |
1939 | 'repository\n')) |
|
1939 | 'repository\n')) | |
1940 | dr.mq.strip(dr, [qbase], update=False, backup=None) |
|
1940 | dr.mq.strip(dr, [qbase], update=False, backup=None) | |
1941 |
if not opts |
|
1941 | if not opts.get('noupdate'): | |
1942 | ui.note(_('updating destination repository\n')) |
|
1942 | ui.note(_('updating destination repository\n')) | |
1943 | hg.update(dr, dr.changelog.tip()) |
|
1943 | hg.update(dr, dr.changelog.tip()) | |
1944 |
|
1944 | |||
@@ -1954,7 +1954,7 b' def commit(ui, repo, *pats, **opts):' | |||||
1954 |
|
1954 | |||
1955 | def series(ui, repo, **opts): |
|
1955 | def series(ui, repo, **opts): | |
1956 | """print the entire series file""" |
|
1956 | """print the entire series file""" | |
1957 |
repo.mq.qseries(repo, missing=opts |
|
1957 | repo.mq.qseries(repo, missing=opts.get('missing'), summary=opts.get('summary')) | |
1958 | return 0 |
|
1958 | return 0 | |
1959 |
|
1959 | |||
1960 | def top(ui, repo, **opts): |
|
1960 | def top(ui, repo, **opts): | |
@@ -2021,7 +2021,7 b' def new(ui, repo, patch, *args, **opts):' | |||||
2021 | """ |
|
2021 | """ | |
2022 | msg = cmdutil.logmessage(opts) |
|
2022 | msg = cmdutil.logmessage(opts) | |
2023 | def getmsg(): |
|
2023 | def getmsg(): | |
2024 |
return ui.edit(msg, opts |
|
2024 | return ui.edit(msg, opts.get('user') or ui.username()) | |
2025 | q = repo.mq |
|
2025 | q = repo.mq | |
2026 | opts['msg'] = msg |
|
2026 | opts['msg'] = msg | |
2027 | if opts.get('edit'): |
|
2027 | if opts.get('edit'): | |
@@ -2054,7 +2054,7 b' def refresh(ui, repo, *pats, **opts):' | |||||
2054 | """ |
|
2054 | """ | |
2055 | q = repo.mq |
|
2055 | q = repo.mq | |
2056 | message = cmdutil.logmessage(opts) |
|
2056 | message = cmdutil.logmessage(opts) | |
2057 |
if opts |
|
2057 | if opts.get('edit'): | |
2058 | if not q.applied: |
|
2058 | if not q.applied: | |
2059 | ui.write(_("no patches applied\n")) |
|
2059 | ui.write(_("no patches applied\n")) | |
2060 | return 1 |
|
2060 | return 1 | |
@@ -2110,7 +2110,7 b' def fold(ui, repo, *files, **opts):' | |||||
2110 | q.check_localchanges(repo) |
|
2110 | q.check_localchanges(repo) | |
2111 |
|
2111 | |||
2112 | message = cmdutil.logmessage(opts) |
|
2112 | message = cmdutil.logmessage(opts) | |
2113 |
if opts |
|
2113 | if opts.get('edit'): | |
2114 | if message: |
|
2114 | if message: | |
2115 | raise util.Abort(_('option "-e" incompatible with "-m" or "-l"')) |
|
2115 | raise util.Abort(_('option "-e" incompatible with "-m" or "-l"')) | |
2116 |
|
2116 | |||
@@ -2144,7 +2144,7 b' def fold(ui, repo, *files, **opts):' | |||||
2144 | message.extend(msg) |
|
2144 | message.extend(msg) | |
2145 | message = '\n'.join(message) |
|
2145 | message = '\n'.join(message) | |
2146 |
|
2146 | |||
2147 |
if opts |
|
2147 | if opts.get('edit'): | |
2148 | message = ui.edit(message, user or ui.username()) |
|
2148 | message = ui.edit(message, user or ui.username()) | |
2149 |
|
2149 | |||
2150 | diffopts = q.patchopts(q.diffopts(), *patches) |
|
2150 | diffopts = q.patchopts(q.diffopts(), *patches) | |
@@ -2157,9 +2157,9 b' def goto(ui, repo, patch, **opts):' | |||||
2157 | q = repo.mq |
|
2157 | q = repo.mq | |
2158 | patch = q.lookup(patch) |
|
2158 | patch = q.lookup(patch) | |
2159 | if q.isapplied(patch): |
|
2159 | if q.isapplied(patch): | |
2160 |
ret = q.pop(repo, patch, force=opts |
|
2160 | ret = q.pop(repo, patch, force=opts.get('force')) | |
2161 | else: |
|
2161 | else: | |
2162 |
ret = q.push(repo, patch, force=opts |
|
2162 | ret = q.push(repo, patch, force=opts.get('force')) | |
2163 | q.save_dirty() |
|
2163 | q.save_dirty() | |
2164 | return ret |
|
2164 | return ret | |
2165 |
|
2165 | |||
@@ -2205,8 +2205,8 b' def guard(ui, repo, *args, **opts):' | |||||
2205 | applied = set(p.name for p in q.applied) |
|
2205 | applied = set(p.name for p in q.applied) | |
2206 | patch = None |
|
2206 | patch = None | |
2207 | args = list(args) |
|
2207 | args = list(args) | |
2208 |
if opts |
|
2208 | if opts.get('list'): | |
2209 |
if args or opts |
|
2209 | if args or opts.get('none'): | |
2210 | raise util.Abort(_('cannot mix -l/--list with options or arguments')) |
|
2210 | raise util.Abort(_('cannot mix -l/--list with options or arguments')) | |
2211 | for i in xrange(len(q.series)): |
|
2211 | for i in xrange(len(q.series)): | |
2212 | status(i) |
|
2212 | status(i) | |
@@ -2219,7 +2219,7 b' def guard(ui, repo, *args, **opts):' | |||||
2219 | patch = args.pop(0) |
|
2219 | patch = args.pop(0) | |
2220 | if patch is None: |
|
2220 | if patch is None: | |
2221 | raise util.Abort(_('no patch to work with')) |
|
2221 | raise util.Abort(_('no patch to work with')) | |
2222 |
if args or opts |
|
2222 | if args or opts.get('none'): | |
2223 | idx = q.find_series(patch) |
|
2223 | idx = q.find_series(patch) | |
2224 | if idx is None: |
|
2224 | if idx is None: | |
2225 | raise util.Abort(_('no patch named %s') % patch) |
|
2225 | raise util.Abort(_('no patch named %s') % patch) | |
@@ -2276,9 +2276,9 b' def push(ui, repo, patch=None, **opts):' | |||||
2276 | q = repo.mq |
|
2276 | q = repo.mq | |
2277 | mergeq = None |
|
2277 | mergeq = None | |
2278 |
|
2278 | |||
2279 |
if opts |
|
2279 | if opts.get('merge'): | |
2280 |
if opts |
|
2280 | if opts.get('name'): | |
2281 |
newpath = repo.join(opts |
|
2281 | newpath = repo.join(opts.get('name')) | |
2282 | else: |
|
2282 | else: | |
2283 | newpath, i = lastsavename(q.path) |
|
2283 | newpath, i = lastsavename(q.path) | |
2284 | if not newpath: |
|
2284 | if not newpath: | |
@@ -2286,7 +2286,7 b' def push(ui, repo, patch=None, **opts):' | |||||
2286 | return 1 |
|
2286 | return 1 | |
2287 | mergeq = queue(ui, repo.join(""), newpath) |
|
2287 | mergeq = queue(ui, repo.join(""), newpath) | |
2288 | ui.warn(_("merging with queue at: %s\n") % mergeq.path) |
|
2288 | ui.warn(_("merging with queue at: %s\n") % mergeq.path) | |
2289 |
ret = q.push(repo, patch, force=opts |
|
2289 | ret = q.push(repo, patch, force=opts.get('force'), list=opts.get('list'), | |
2290 | mergeq=mergeq, all=opts.get('all'), move=opts.get('move')) |
|
2290 | mergeq=mergeq, all=opts.get('all'), move=opts.get('move')) | |
2291 | return ret |
|
2291 | return ret | |
2292 |
|
2292 | |||
@@ -2298,14 +2298,14 b' def pop(ui, repo, patch=None, **opts):' | |||||
2298 | top of the stack. |
|
2298 | top of the stack. | |
2299 | """ |
|
2299 | """ | |
2300 | localupdate = True |
|
2300 | localupdate = True | |
2301 |
if opts |
|
2301 | if opts.get('name'): | |
2302 |
q = queue(ui, repo.join(""), repo.join(opts |
|
2302 | q = queue(ui, repo.join(""), repo.join(opts.get('name'))) | |
2303 | ui.warn(_('using patch queue: %s\n') % q.path) |
|
2303 | ui.warn(_('using patch queue: %s\n') % q.path) | |
2304 | localupdate = False |
|
2304 | localupdate = False | |
2305 | else: |
|
2305 | else: | |
2306 | q = repo.mq |
|
2306 | q = repo.mq | |
2307 |
ret = q.pop(repo, patch, force=opts |
|
2307 | ret = q.pop(repo, patch, force=opts.get('force'), update=localupdate, | |
2308 |
all=opts |
|
2308 | all=opts.get('all')) | |
2309 | q.save_dirty() |
|
2309 | q.save_dirty() | |
2310 | return ret |
|
2310 | return ret | |
2311 |
|
2311 | |||
@@ -2379,8 +2379,8 b' def restore(ui, repo, rev, **opts):' | |||||
2379 | This command is deprecated, use rebase --mq instead.""" |
|
2379 | This command is deprecated, use rebase --mq instead.""" | |
2380 | rev = repo.lookup(rev) |
|
2380 | rev = repo.lookup(rev) | |
2381 | q = repo.mq |
|
2381 | q = repo.mq | |
2382 |
q.restore(repo, rev, delete=opts |
|
2382 | q.restore(repo, rev, delete=opts.get('delete'), | |
2383 |
qupdate=opts |
|
2383 | qupdate=opts.get('update')) | |
2384 | q.save_dirty() |
|
2384 | q.save_dirty() | |
2385 | return 0 |
|
2385 | return 0 | |
2386 |
|
2386 | |||
@@ -2394,22 +2394,22 b' def save(ui, repo, **opts):' | |||||
2394 | if ret: |
|
2394 | if ret: | |
2395 | return ret |
|
2395 | return ret | |
2396 | q.save_dirty() |
|
2396 | q.save_dirty() | |
2397 |
if opts |
|
2397 | if opts.get('copy'): | |
2398 | path = q.path |
|
2398 | path = q.path | |
2399 |
if opts |
|
2399 | if opts.get('name'): | |
2400 |
newpath = os.path.join(q.basepath, opts |
|
2400 | newpath = os.path.join(q.basepath, opts.get('name')) | |
2401 | if os.path.exists(newpath): |
|
2401 | if os.path.exists(newpath): | |
2402 | if not os.path.isdir(newpath): |
|
2402 | if not os.path.isdir(newpath): | |
2403 | raise util.Abort(_('destination %s exists and is not ' |
|
2403 | raise util.Abort(_('destination %s exists and is not ' | |
2404 | 'a directory') % newpath) |
|
2404 | 'a directory') % newpath) | |
2405 |
if not opts |
|
2405 | if not opts.get('force'): | |
2406 | raise util.Abort(_('destination %s exists, ' |
|
2406 | raise util.Abort(_('destination %s exists, ' | |
2407 | 'use -f to force') % newpath) |
|
2407 | 'use -f to force') % newpath) | |
2408 | else: |
|
2408 | else: | |
2409 | newpath = savename(path) |
|
2409 | newpath = savename(path) | |
2410 | ui.warn(_("copy %s to %s\n") % (path, newpath)) |
|
2410 | ui.warn(_("copy %s to %s\n") % (path, newpath)) | |
2411 | util.copyfiles(path, newpath) |
|
2411 | util.copyfiles(path, newpath) | |
2412 |
if opts |
|
2412 | if opts.get('empty'): | |
2413 | try: |
|
2413 | try: | |
2414 | os.unlink(q.join(q.status_path)) |
|
2414 | os.unlink(q.join(q.status_path)) | |
2415 | except: |
|
2415 | except: | |
@@ -2439,9 +2439,9 b' def strip(ui, repo, *revs, **opts):' | |||||
2439 | operation completes. |
|
2439 | operation completes. | |
2440 | """ |
|
2440 | """ | |
2441 | backup = 'all' |
|
2441 | backup = 'all' | |
2442 |
if opts |
|
2442 | if opts.get('backup'): | |
2443 | backup = 'strip' |
|
2443 | backup = 'strip' | |
2444 |
elif opts |
|
2444 | elif opts.get('nobackup'): | |
2445 | backup = 'none' |
|
2445 | backup = 'none' | |
2446 |
|
2446 | |||
2447 | cl = repo.changelog |
|
2447 | cl = repo.changelog | |
@@ -2479,7 +2479,7 b' def strip(ui, repo, *revs, **opts):' | |||||
2479 | q.save_dirty() |
|
2479 | q.save_dirty() | |
2480 |
|
2480 | |||
2481 | repo.mq.strip(repo, list(rootnodes), backup=backup, update=update, |
|
2481 | repo.mq.strip(repo, list(rootnodes), backup=backup, update=update, | |
2482 |
force=opts |
|
2482 | force=opts.get('force')) | |
2483 | return 0 |
|
2483 | return 0 | |
2484 |
|
2484 | |||
2485 | def select(ui, repo, *args, **opts): |
|
2485 | def select(ui, repo, *args, **opts): | |
@@ -2517,7 +2517,7 b' def select(ui, repo, *args, **opts):' | |||||
2517 |
|
2517 | |||
2518 | q = repo.mq |
|
2518 | q = repo.mq | |
2519 | guards = q.active() |
|
2519 | guards = q.active() | |
2520 |
if args or opts |
|
2520 | if args or opts.get('none'): | |
2521 | old_unapplied = q.unapplied(repo) |
|
2521 | old_unapplied = q.unapplied(repo) | |
2522 | old_guarded = [i for i in xrange(len(q.applied)) if |
|
2522 | old_guarded = [i for i in xrange(len(q.applied)) if | |
2523 | not q.pushable(i)[0]] |
|
2523 | not q.pushable(i)[0]] | |
@@ -2525,7 +2525,7 b' def select(ui, repo, *args, **opts):' | |||||
2525 | q.save_dirty() |
|
2525 | q.save_dirty() | |
2526 | if not args: |
|
2526 | if not args: | |
2527 | ui.status(_('guards deactivated\n')) |
|
2527 | ui.status(_('guards deactivated\n')) | |
2528 |
if not opts |
|
2528 | if not opts.get('pop') and not opts.get('reapply'): | |
2529 | unapplied = q.unapplied(repo) |
|
2529 | unapplied = q.unapplied(repo) | |
2530 | guarded = [i for i in xrange(len(q.applied)) |
|
2530 | guarded = [i for i in xrange(len(q.applied)) | |
2531 | if not q.pushable(i)[0]] |
|
2531 | if not q.pushable(i)[0]] | |
@@ -2537,7 +2537,7 b' def select(ui, repo, *args, **opts):' | |||||
2537 | ui.status(_('number of guarded, applied patches has changed ' |
|
2537 | ui.status(_('number of guarded, applied patches has changed ' | |
2538 | 'from %d to %d\n') % |
|
2538 | 'from %d to %d\n') % | |
2539 | (len(old_guarded), len(guarded))) |
|
2539 | (len(old_guarded), len(guarded))) | |
2540 |
elif opts |
|
2540 | elif opts.get('series'): | |
2541 | guards = {} |
|
2541 | guards = {} | |
2542 | noguards = 0 |
|
2542 | noguards = 0 | |
2543 | for gs in q.series_guards: |
|
2543 | for gs in q.series_guards: | |
@@ -2564,9 +2564,9 b' def select(ui, repo, *args, **opts):' | |||||
2564 | ui.write(g, '\n') |
|
2564 | ui.write(g, '\n') | |
2565 | else: |
|
2565 | else: | |
2566 | ui.write(_('no active guards\n')) |
|
2566 | ui.write(_('no active guards\n')) | |
2567 |
reapply = opts |
|
2567 | reapply = opts.get('reapply') and q.applied and q.appliedname(-1) | |
2568 | popped = False |
|
2568 | popped = False | |
2569 |
if opts |
|
2569 | if opts.get('pop') or opts.get('reapply'): | |
2570 | for i in xrange(len(q.applied)): |
|
2570 | for i in xrange(len(q.applied)): | |
2571 | pushable, reason = q.pushable(i) |
|
2571 | pushable, reason = q.pushable(i) | |
2572 | if not pushable: |
|
2572 | if not pushable: | |
@@ -2601,9 +2601,9 b' def finish(ui, repo, *revrange, **opts):' | |||||
2601 | an upstream repository, or if you are about to push your changes |
|
2601 | an upstream repository, or if you are about to push your changes | |
2602 | to upstream. |
|
2602 | to upstream. | |
2603 | """ |
|
2603 | """ | |
2604 |
if not opts |
|
2604 | if not opts.get('applied') and not revrange: | |
2605 | raise util.Abort(_('no revisions specified')) |
|
2605 | raise util.Abort(_('no revisions specified')) | |
2606 |
elif opts |
|
2606 | elif opts.get('applied'): | |
2607 | revrange = ('qbase::qtip',) + revrange |
|
2607 | revrange = ('qbase::qtip',) + revrange | |
2608 |
|
2608 | |||
2609 | q = repo.mq |
|
2609 | q = repo.mq |
General Comments 0
You need to be logged in to leave comments.
Login now