##// END OF EJS Templates
mq: added return 0 on success...
Erik Zielke -
r12538:c87216e5 default
parent child Browse files
Show More
@@ -1753,7 +1753,9 b' def delete(ui, repo, *patches, **opts):'
1753 return 0
1753 return 0
1754
1754
1755 def applied(ui, repo, patch=None, **opts):
1755 def applied(ui, repo, patch=None, **opts):
1756 """print the patches already applied"""
1756 """print the patches already applied
1757
1758 Returns 0 on success."""
1757
1759
1758 q = repo.mq
1760 q = repo.mq
1759
1761
@@ -1780,7 +1782,9 b' def applied(ui, repo, patch=None, **opts'
1780 summary=opts.get('summary'))
1782 summary=opts.get('summary'))
1781
1783
1782 def unapplied(ui, repo, patch=None, **opts):
1784 def unapplied(ui, repo, patch=None, **opts):
1783 """print the patches not yet applied"""
1785 """print the patches not yet applied
1786
1787 Returns 0 on success."""
1784
1788
1785 q = repo.mq
1789 q = repo.mq
1786 if patch:
1790 if patch:
@@ -1828,6 +1832,8 b' def qimport(ui, repo, *filename, **opts)'
1828 To import an existing patch while renaming it::
1832 To import an existing patch while renaming it::
1829
1833
1830 hg qimport -e existing-patch -n new-name
1834 hg qimport -e existing-patch -n new-name
1835
1836 Returns 0 if import succeeded.
1831 """
1837 """
1832 q = repo.mq
1838 q = repo.mq
1833 try:
1839 try:
@@ -1846,7 +1852,9 b' def qinit(ui, repo, create):'
1846
1852
1847 This command also creates a series file for ordering patches, and
1853 This command also creates a series file for ordering patches, and
1848 an mq-specific .hgignore file in the queue repository, to exclude
1854 an mq-specific .hgignore file in the queue repository, to exclude
1849 the status and guards files (these contain mostly transient state)."""
1855 the status and guards files (these contain mostly transient state).
1856
1857 Returns 0 if initialization succeeded."""
1850 q = repo.mq
1858 q = repo.mq
1851 r = q.init(repo, create)
1859 r = q.init(repo, create)
1852 q.save_dirty()
1860 q.save_dirty()
@@ -1892,6 +1900,8 b' def clone(ui, source, dest=None, **opts)'
1892
1900
1893 The patch directory must be a nested Mercurial repository, as
1901 The patch directory must be a nested Mercurial repository, as
1894 would be created by :hg:`init --mq`.
1902 would be created by :hg:`init --mq`.
1903
1904 Return 0 on success.
1895 '''
1905 '''
1896 def patchdir(repo):
1906 def patchdir(repo):
1897 url = repo.url()
1907 url = repo.url()
@@ -1953,12 +1963,16 b' def commit(ui, repo, *pats, **opts):'
1953 commands.commit(r.ui, r, *pats, **opts)
1963 commands.commit(r.ui, r, *pats, **opts)
1954
1964
1955 def series(ui, repo, **opts):
1965 def series(ui, repo, **opts):
1956 """print the entire series file"""
1966 """print the entire series file
1967
1968 Returns 0 on success."""
1957 repo.mq.qseries(repo, missing=opts.get('missing'), summary=opts.get('summary'))
1969 repo.mq.qseries(repo, missing=opts.get('missing'), summary=opts.get('summary'))
1958 return 0
1970 return 0
1959
1971
1960 def top(ui, repo, **opts):
1972 def top(ui, repo, **opts):
1961 """print the name of the current patch"""
1973 """print the name of the current patch
1974
1975 Returns 0 on success."""
1962 q = repo.mq
1976 q = repo.mq
1963 t = q.applied and q.series_end(True) or 0
1977 t = q.applied and q.series_end(True) or 0
1964 if t:
1978 if t:
@@ -1969,7 +1983,9 b' def top(ui, repo, **opts):'
1969 return 1
1983 return 1
1970
1984
1971 def next(ui, repo, **opts):
1985 def next(ui, repo, **opts):
1972 """print the name of the next patch"""
1986 """print the name of the next patch
1987
1988 Returns 0 on success."""
1973 q = repo.mq
1989 q = repo.mq
1974 end = q.series_end()
1990 end = q.series_end()
1975 if end == len(q.series):
1991 if end == len(q.series):
@@ -1978,7 +1994,9 b' def next(ui, repo, **opts):'
1978 return q.qseries(repo, start=end, length=1, summary=opts.get('summary'))
1994 return q.qseries(repo, start=end, length=1, summary=opts.get('summary'))
1979
1995
1980 def prev(ui, repo, **opts):
1996 def prev(ui, repo, **opts):
1981 """print the name of the previous patch"""
1997 """print the name of the previous patch
1998
1999 Returns 0 on success."""
1982 q = repo.mq
2000 q = repo.mq
1983 l = len(q.applied)
2001 l = len(q.applied)
1984 if l == 1:
2002 if l == 1:
@@ -2018,6 +2036,8 b' def new(ui, repo, patch, *args, **opts):'
2018 format. Read the diffs help topic for more information on why this
2036 format. Read the diffs help topic for more information on why this
2019 is important for preserving permission changes and copy/rename
2037 is important for preserving permission changes and copy/rename
2020 information.
2038 information.
2039
2040 Returns 0 on successful creation of a new patch.
2021 """
2041 """
2022 msg = cmdutil.logmessage(opts)
2042 msg = cmdutil.logmessage(opts)
2023 def getmsg():
2043 def getmsg():
@@ -2051,6 +2071,8 b' def refresh(ui, repo, *pats, **opts):'
2051 use git-style patches (-g/--git or [diff] git=1) to track copies
2071 use git-style patches (-g/--git or [diff] git=1) to track copies
2052 and renames. See the diffs help topic for more information on the
2072 and renames. See the diffs help topic for more information on the
2053 git diff format.
2073 git diff format.
2074
2075 Returns 0 on success.
2054 """
2076 """
2055 q = repo.mq
2077 q = repo.mq
2056 message = cmdutil.logmessage(opts)
2078 message = cmdutil.logmessage(opts)
@@ -2084,6 +2106,8 b' def diff(ui, repo, *pats, **opts):'
2084 last qrefresh, or :hg:`export qtip` if you want to see changes
2106 last qrefresh, or :hg:`export qtip` if you want to see changes
2085 made by the current patch without including changes made since the
2107 made by the current patch without including changes made since the
2086 qrefresh.
2108 qrefresh.
2109
2110 Returns 0 on success.
2087 """
2111 """
2088 repo.mq.diff(repo, pats, opts)
2112 repo.mq.diff(repo, pats, opts)
2089 return 0
2113 return 0
@@ -2099,7 +2123,9 b' def fold(ui, repo, *files, **opts):'
2099 removed afterwards.
2123 removed afterwards.
2100
2124
2101 The header for each folded patch will be concatenated with the
2125 The header for each folded patch will be concatenated with the
2102 current patch header, separated by a line of '* * *'."""
2126 current patch header, separated by a line of '* * *'.
2127
2128 Returns 0 on success."""
2103
2129
2104 q = repo.mq
2130 q = repo.mq
2105
2131
@@ -2153,7 +2179,9 b' def fold(ui, repo, *files, **opts):'
2153 q.save_dirty()
2179 q.save_dirty()
2154
2180
2155 def goto(ui, repo, patch, **opts):
2181 def goto(ui, repo, patch, **opts):
2156 '''push or pop patches until named patch is at top of stack'''
2182 '''push or pop patches until named patch is at top of stack
2183
2184 Returns 0 on success.'''
2157 q = repo.mq
2185 q = repo.mq
2158 patch = q.lookup(patch)
2186 patch = q.lookup(patch)
2159 if q.isapplied(patch):
2187 if q.isapplied(patch):
@@ -2181,6 +2209,8 b' def guard(ui, repo, *args, **opts):'
2181 To set guards on another patch::
2209 To set guards on another patch::
2182
2210
2183 hg qguard other.patch -- +2.6.17 -stable
2211 hg qguard other.patch -- +2.6.17 -stable
2212
2213 Returns 0 on success.
2184 '''
2214 '''
2185 def status(idx):
2215 def status(idx):
2186 guards = q.series_guards[idx] or ['unguarded']
2216 guards = q.series_guards[idx] or ['unguarded']
@@ -2231,7 +2261,9 b' def guard(ui, repo, *args, **opts):'
2231 status(q.series.index(q.lookup(patch)))
2261 status(q.series.index(q.lookup(patch)))
2232
2262
2233 def header(ui, repo, patch=None):
2263 def header(ui, repo, patch=None):
2234 """print the header of the topmost or specified patch"""
2264 """print the header of the topmost or specified patch
2265
2266 Returns 0 on success."""
2235 q = repo.mq
2267 q = repo.mq
2236
2268
2237 if patch:
2269 if patch:
@@ -2274,6 +2306,8 b' def push(ui, repo, patch=None, **opts):'
2274
2306
2275 When -f/--force is applied, all local changes in patched files
2307 When -f/--force is applied, all local changes in patched files
2276 will be lost.
2308 will be lost.
2309
2310 Return 0 on succces.
2277 """
2311 """
2278 q = repo.mq
2312 q = repo.mq
2279 mergeq = None
2313 mergeq = None
@@ -2298,6 +2332,8 b' def pop(ui, repo, patch=None, **opts):'
2298 By default, pops off the top of the patch stack. If given a patch
2332 By default, pops off the top of the patch stack. If given a patch
2299 name, keeps popping off patches until the named patch is at the
2333 name, keeps popping off patches until the named patch is at the
2300 top of the stack.
2334 top of the stack.
2335
2336 Return 0 on success.
2301 """
2337 """
2302 localupdate = True
2338 localupdate = True
2303 if opts.get('name'):
2339 if opts.get('name'):
@@ -2315,7 +2351,9 b' def rename(ui, repo, patch, name=None, *'
2315 """rename a patch
2351 """rename a patch
2316
2352
2317 With one argument, renames the current patch to PATCH1.
2353 With one argument, renames the current patch to PATCH1.
2318 With two arguments, renames PATCH1 to PATCH2."""
2354 With two arguments, renames PATCH1 to PATCH2.
2355
2356 Returns 0 on success."""
2319
2357
2320 q = repo.mq
2358 q = repo.mq
2321
2359
@@ -2439,6 +2477,8 b' def strip(ui, repo, *revs, **opts):'
2439
2477
2440 Use the --no-backup option to discard the backup bundle once the
2478 Use the --no-backup option to discard the backup bundle once the
2441 operation completes.
2479 operation completes.
2480
2481 Return 0 on success.
2442 """
2482 """
2443 backup = 'all'
2483 backup = 'all'
2444 if opts.get('backup'):
2484 if opts.get('backup'):
@@ -2515,7 +2555,9 b' def select(ui, repo, *args, **opts):'
2515 guarded patches.
2555 guarded patches.
2516
2556
2517 Use -s/--series to print a list of all guards in the series file
2557 Use -s/--series to print a list of all guards in the series file
2518 (no other arguments needed). Use -v for more information.'''
2558 (no other arguments needed). Use -v for more information.
2559
2560 Returns 0 on success.'''
2519
2561
2520 q = repo.mq
2562 q = repo.mq
2521 guards = q.active()
2563 guards = q.active()
@@ -2602,6 +2644,8 b' def finish(ui, repo, *revrange, **opts):'
2602 This can be especially useful if your changes have been applied to
2644 This can be especially useful if your changes have been applied to
2603 an upstream repository, or if you are about to push your changes
2645 an upstream repository, or if you are about to push your changes
2604 to upstream.
2646 to upstream.
2647
2648 Returns 0 on success.
2605 """
2649 """
2606 if not opts.get('applied') and not revrange:
2650 if not opts.get('applied') and not revrange:
2607 raise util.Abort(_('no revisions specified'))
2651 raise util.Abort(_('no revisions specified'))
@@ -2635,6 +2679,8 b' def qqueue(ui, repo, name=None, **opts):'
2635
2679
2636 To delete an existing queue, use --delete. You cannot delete the currently
2680 To delete an existing queue, use --delete. You cannot delete the currently
2637 active queue.
2681 active queue.
2682
2683 Returns 0 on success.
2638 '''
2684 '''
2639
2685
2640 q = repo.mq
2686 q = repo.mq
General Comments 0
You need to be logged in to leave comments. Login now