##// END OF EJS Templates
add -b/--branch option to clone, bundle, incoming, outgoing, pull, push
Sune Foldager -
r10379:a78bfaf9 default
parent child Browse files
Show More
@@ -277,7 +277,7 b' def goutgoing(ui, repo, dest=None, **opt'
277
277
278 check_unsupported_flags(opts)
278 check_unsupported_flags(opts)
279 dest = ui.expandpath(dest or 'default-push', dest or 'default')
279 dest = ui.expandpath(dest or 'default-push', dest or 'default')
280 dest, branches = hg.parseurl(dest)
280 dest, branches = hg.parseurl(dest, opts.get('branch'))
281 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
281 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
282 other = hg.repository(cmdutil.remoteui(ui, opts), dest)
282 other = hg.repository(cmdutil.remoteui(ui, opts), dest)
283 if revs:
283 if revs:
@@ -305,7 +305,7 b' def gincoming(ui, repo, source="default"'
305 """
305 """
306
306
307 check_unsupported_flags(opts)
307 check_unsupported_flags(opts)
308 source, branches = hg.parseurl(ui.expandpath(source))
308 source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
309 other = hg.repository(cmdutil.remoteui(repo, opts), source)
309 other = hg.repository(cmdutil.remoteui(repo, opts), source)
310 revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
310 revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
311 ui.status(_('comparing with %s\n') % url.hidepassword(source))
311 ui.status(_('comparing with %s\n') % url.hidepassword(source))
@@ -538,7 +538,7 b' def bundle(ui, repo, fname, dest=None, *'
538 visit.append(p)
538 visit.append(p)
539 else:
539 else:
540 dest = ui.expandpath(dest or 'default-push', dest or 'default')
540 dest = ui.expandpath(dest or 'default-push', dest or 'default')
541 dest, branches = hg.parseurl(dest)
541 dest, branches = hg.parseurl(dest, opts.get('branch'))
542 other = hg.repository(cmdutil.remoteui(repo, opts), dest)
542 other = hg.repository(cmdutil.remoteui(repo, opts), dest)
543 revs, checkout = hg.addbranchrevs(repo, other, branches, revs)
543 revs, checkout = hg.addbranchrevs(repo, other, branches, revs)
544 o = repo.findoutgoing(other, force=opts.get('force'))
544 o = repo.findoutgoing(other, force=opts.get('force'))
@@ -607,8 +607,9 b' def clone(ui, source, dest=None, **opts)'
607
607
608 a) the changeset, tag or branch specified with -u/--updaterev
608 a) the changeset, tag or branch specified with -u/--updaterev
609 b) the changeset, tag or branch given with the first -r/--rev
609 b) the changeset, tag or branch given with the first -r/--rev
610 c) the branch given with the url#branch source syntax
610 c) the branch given with the first -b/--branch
611 d) the head of the default branch
611 d) the branch given with the url#branch source syntax
612 e) the head of the default branch
612
613
613 Use 'hg clone -u . src dst' to checkout the source repository's
614 Use 'hg clone -u . src dst' to checkout the source repository's
614 parent changeset (applicable for local source repositories only).
615 parent changeset (applicable for local source repositories only).
@@ -651,7 +652,8 b' def clone(ui, source, dest=None, **opts)'
651 pull=opts.get('pull'),
652 pull=opts.get('pull'),
652 stream=opts.get('uncompressed'),
653 stream=opts.get('uncompressed'),
653 rev=opts.get('rev'),
654 rev=opts.get('rev'),
654 update=opts.get('updaterev') or not opts.get('noupdate'))
655 update=opts.get('updaterev') or not opts.get('noupdate'),
656 branch=opts.get('branch'))
655
657
656 def commit(ui, repo, *pats, **opts):
658 def commit(ui, repo, *pats, **opts):
657 """commit the specified files or all outstanding changes
659 """commit the specified files or all outstanding changes
@@ -1921,7 +1923,7 b' def incoming(ui, repo, source="default",'
1921 See pull for valid source format details.
1923 See pull for valid source format details.
1922 """
1924 """
1923 limit = cmdutil.loglimit(opts)
1925 limit = cmdutil.loglimit(opts)
1924 source, branches = hg.parseurl(ui.expandpath(source))
1926 source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
1925 other = hg.repository(cmdutil.remoteui(repo, opts), source)
1927 other = hg.repository(cmdutil.remoteui(repo, opts), source)
1926 ui.status(_('comparing with %s\n') % url.hidepassword(source))
1928 ui.status(_('comparing with %s\n') % url.hidepassword(source))
1927 revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
1929 revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
@@ -2210,7 +2212,7 b' def outgoing(ui, repo, dest=None, **opts'
2210 """
2212 """
2211 limit = cmdutil.loglimit(opts)
2213 limit = cmdutil.loglimit(opts)
2212 dest = ui.expandpath(dest or 'default-push', dest or 'default')
2214 dest = ui.expandpath(dest or 'default-push', dest or 'default')
2213 dest, branches = hg.parseurl(dest)
2215 dest, branches = hg.parseurl(dest, opts.get('branch'))
2214 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
2216 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
2215 if revs:
2217 if revs:
2216 revs = [repo.lookup(rev) for rev in revs]
2218 revs = [repo.lookup(rev) for rev in revs]
@@ -2330,7 +2332,7 b' def pull(ui, repo, source="default", **o'
2330 If SOURCE is omitted, the 'default' path will be used.
2332 If SOURCE is omitted, the 'default' path will be used.
2331 See 'hg help urls' for more information.
2333 See 'hg help urls' for more information.
2332 """
2334 """
2333 source, branches = hg.parseurl(ui.expandpath(source))
2335 source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
2334 other = hg.repository(cmdutil.remoteui(repo, opts), source)
2336 other = hg.repository(cmdutil.remoteui(repo, opts), source)
2335 ui.status(_('pulling from %s\n') % url.hidepassword(source))
2337 ui.status(_('pulling from %s\n') % url.hidepassword(source))
2336 revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
2338 revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
@@ -2368,7 +2370,7 b' def push(ui, repo, dest=None, **opts):'
2368 URLs. If DESTINATION is omitted, a default path will be used.
2370 URLs. If DESTINATION is omitted, a default path will be used.
2369 """
2371 """
2370 dest = ui.expandpath(dest or 'default-push', dest or 'default')
2372 dest = ui.expandpath(dest or 'default-push', dest or 'default')
2371 dest, branches = hg.parseurl(dest)
2373 dest, branches = hg.parseurl(dest, opts.get('branch'))
2372 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
2374 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
2373 other = hg.repository(cmdutil.remoteui(repo, opts), dest)
2375 other = hg.repository(cmdutil.remoteui(repo, opts), dest)
2374 ui.status(_('pushing to %s\n') % url.hidepassword(dest))
2376 ui.status(_('pushing to %s\n') % url.hidepassword(dest))
@@ -3415,6 +3417,8 b' table = {'
3415 _('run even when the destination is unrelated')),
3417 _('run even when the destination is unrelated')),
3416 ('r', 'rev', [],
3418 ('r', 'rev', [],
3417 _('a changeset intended to be added to the destination')),
3419 _('a changeset intended to be added to the destination')),
3420 ('b', 'branch', [],
3421 _('a specific branch you would like to bundle')),
3418 ('', 'base', [],
3422 ('', 'base', [],
3419 _('a base changeset assumed to be available at the destination')),
3423 _('a base changeset assumed to be available at the destination')),
3420 ('a', 'all', None, _('bundle all changesets in the repository')),
3424 ('a', 'all', None, _('bundle all changesets in the repository')),
@@ -3436,6 +3440,8 b' table = {'
3436 _('revision, tag or branch to check out')),
3440 _('revision, tag or branch to check out')),
3437 ('r', 'rev', [],
3441 ('r', 'rev', [],
3438 _('include the specified changeset')),
3442 _('include the specified changeset')),
3443 ('b', 'branch', [],
3444 _('clone only the specified branch')),
3439 ('', 'pull', None, _('use pull protocol to copy metadata')),
3445 ('', 'pull', None, _('use pull protocol to copy metadata')),
3440 ('', 'uncompressed', None,
3446 ('', 'uncompressed', None,
3441 _('use uncompressed transfer (fast over LAN)')),
3447 _('use uncompressed transfer (fast over LAN)')),
@@ -3567,6 +3573,8 b' table = {'
3567 ('', 'bundle', '', _('file to store the bundles into')),
3573 ('', 'bundle', '', _('file to store the bundles into')),
3568 ('r', 'rev', [],
3574 ('r', 'rev', [],
3569 _('a remote changeset intended to be added')),
3575 _('a remote changeset intended to be added')),
3576 ('b', 'branch', [],
3577 _('a specific branch you would like to pull')),
3570 ] + logopts + remoteopts,
3578 ] + logopts + remoteopts,
3571 _('[-p] [-n] [-M] [-f] [-r REV]...'
3579 _('[-p] [-n] [-M] [-f] [-r REV]...'
3572 ' [--bundle FILENAME] [SOURCE]')),
3580 ' [--bundle FILENAME] [SOURCE]')),
@@ -3621,6 +3629,8 b' table = {'
3621 ('r', 'rev', [],
3629 ('r', 'rev', [],
3622 _('a changeset intended to be included in the destination')),
3630 _('a changeset intended to be included in the destination')),
3623 ('n', 'newest-first', None, _('show newest record first')),
3631 ('n', 'newest-first', None, _('show newest record first')),
3632 ('b', 'branch', [],
3633 _('a specific branch you would like to push')),
3624 ] + logopts + remoteopts,
3634 ] + logopts + remoteopts,
3625 _('[-M] [-p] [-n] [-f] [-r REV]... [DEST]')),
3635 _('[-M] [-p] [-n] [-f] [-r REV]... [DEST]')),
3626 "parents":
3636 "parents":
@@ -3637,6 +3647,8 b' table = {'
3637 _('run even when remote repository is unrelated')),
3647 _('run even when remote repository is unrelated')),
3638 ('r', 'rev', [],
3648 ('r', 'rev', [],
3639 _('a remote changeset intended to be added')),
3649 _('a remote changeset intended to be added')),
3650 ('b', 'branch', [],
3651 _('a specific branch you would like to pull')),
3640 ] + remoteopts,
3652 ] + remoteopts,
3641 _('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]')),
3653 _('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]')),
3642 "^push":
3654 "^push":
@@ -3644,6 +3656,8 b' table = {'
3644 [('f', 'force', None, _('force push')),
3656 [('f', 'force', None, _('force push')),
3645 ('r', 'rev', [],
3657 ('r', 'rev', [],
3646 _('a changeset intended to be included in the destination')),
3658 _('a changeset intended to be included in the destination')),
3659 ('b', 'branch', [],
3660 _('a specific branch you would like to push')),
3647 ] + remoteopts,
3661 ] + remoteopts,
3648 _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')),
3662 _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')),
3649 "recover": (recover, []),
3663 "recover": (recover, []),
@@ -164,7 +164,7 b' def share(ui, source, dest=None, update='
164 _update(r, uprev)
164 _update(r, uprev)
165
165
166 def clone(ui, source, dest=None, pull=False, rev=None, update=True,
166 def clone(ui, source, dest=None, pull=False, rev=None, update=True,
167 stream=False):
167 stream=False, branch=None):
168 """Make a copy of an existing repository.
168 """Make a copy of an existing repository.
169
169
170 Create a copy of an existing repository in a new directory. The
170 Create a copy of an existing repository in a new directory. The
@@ -196,11 +196,13 b' def clone(ui, source, dest=None, pull=Fa'
196 update: update working directory after clone completes, if
196 update: update working directory after clone completes, if
197 destination is local repository (True means update to default rev,
197 destination is local repository (True means update to default rev,
198 anything else is treated as a revision)
198 anything else is treated as a revision)
199
200 branch: branches to clone
199 """
201 """
200
202
201 if isinstance(source, str):
203 if isinstance(source, str):
202 origsource = ui.expandpath(source)
204 origsource = ui.expandpath(source)
203 source, branch = parseurl(origsource)
205 source, branch = parseurl(origsource, branch)
204 src_repo = repository(ui, source)
206 src_repo = repository(ui, source)
205 else:
207 else:
206 src_repo = source
208 src_repo = source
@@ -26,8 +26,10 b" hg ci -d '0 0' -mb2"
26
26
27 echo in rev c branch a
27 echo in rev c branch a
28 hg in -qr c ../branch#a
28 hg in -qr c ../branch#a
29 hg in -qr c -b a
29 echo out branch .
30 echo out branch .
30 hg out -q ../branch#.
31 hg out -q ../branch#.
32 hg out -q -b .
31 echo clone branch b
33 echo clone branch b
32 cd ..
34 cd ..
33 hg clone branch2#b branch3
35 hg clone branch2#b branch3
@@ -18,8 +18,11 b' created new head'
18 in rev c branch a
18 in rev c branch a
19 1:dd6e60a716c6
19 1:dd6e60a716c6
20 2:f25d57ab0566
20 2:f25d57ab0566
21 1:dd6e60a716c6
22 2:f25d57ab0566
21 out branch .
23 out branch .
22 2:65511d0e2b55
24 2:65511d0e2b55
25 2:65511d0e2b55
23 clone branch b
26 clone branch b
24 requesting all changes
27 requesting all changes
25 adding changesets
28 adding changesets
@@ -165,7 +165,7 b" hg: command 's' is ambiguous:"
165 % Show all commands + options
165 % Show all commands + options
166 add: include, exclude, dry-run
166 add: include, exclude, dry-run
167 annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, include, exclude
167 annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, include, exclude
168 clone: noupdate, updaterev, rev, pull, uncompressed, ssh, remotecmd
168 clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd
169 commit: addremove, close-branch, include, exclude, message, logfile, date, user
169 commit: addremove, close-branch, include, exclude, message, logfile, date, user
170 diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude
170 diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude
171 export: output, switch-parent, rev, text, git, nodates
171 export: output, switch-parent, rev, text, git, nodates
@@ -173,8 +173,8 b' forget: include, exclude'
173 init: ssh, remotecmd
173 init: ssh, remotecmd
174 log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, prune, patch, git, limit, no-merges, style, template, include, exclude
174 log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, prune, patch, git, limit, no-merges, style, template, include, exclude
175 merge: force, rev, preview
175 merge: force, rev, preview
176 pull: update, force, rev, ssh, remotecmd
176 pull: update, force, rev, branch, ssh, remotecmd
177 push: force, rev, ssh, remotecmd
177 push: force, rev, branch, ssh, remotecmd
178 remove: after, force, include, exclude
178 remove: after, force, include, exclude
179 serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, webdir-conf, pid-file, stdio, templates, style, ipv6, certificate
179 serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, webdir-conf, pid-file, stdio, templates, style, ipv6, certificate
180 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude
180 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude
@@ -186,7 +186,7 b' backout: merge, parent, rev, include, ex'
186 bisect: reset, good, bad, skip, command, noupdate
186 bisect: reset, good, bad, skip, command, noupdate
187 branch: force, clean
187 branch: force, clean
188 branches: active, closed
188 branches: active, closed
189 bundle: force, rev, base, all, type, ssh, remotecmd
189 bundle: force, rev, branch, base, all, type, ssh, remotecmd
190 cat: output, rev, decode, include, exclude
190 cat: output, rev, decode, include, exclude
191 copy: after, force, include, exclude, dry-run
191 copy: after, force, include, exclude, dry-run
192 debugancestor:
192 debugancestor:
@@ -210,10 +210,10 b' heads: rev, topo, active, closed, style,'
210 help:
210 help:
211 identify: rev, num, id, branch, tags
211 identify: rev, num, id, branch, tags
212 import: strip, base, force, no-commit, exact, import-branch, message, logfile, date, user, similarity
212 import: strip, base, force, no-commit, exact, import-branch, message, logfile, date, user, similarity
213 incoming: force, newest-first, bundle, rev, patch, git, limit, no-merges, style, template, ssh, remotecmd
213 incoming: force, newest-first, bundle, rev, branch, patch, git, limit, no-merges, style, template, ssh, remotecmd
214 locate: rev, print0, fullpath, include, exclude
214 locate: rev, print0, fullpath, include, exclude
215 manifest: rev
215 manifest: rev
216 outgoing: force, rev, newest-first, patch, git, limit, no-merges, style, template, ssh, remotecmd
216 outgoing: force, rev, newest-first, branch, patch, git, limit, no-merges, style, template, ssh, remotecmd
217 parents: rev, style, template
217 parents: rev, style, template
218 paths:
218 paths:
219 recover:
219 recover:
General Comments 0
You need to be logged in to leave comments. Login now