Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 9714:2f1ab7f77ddc
clone: add option -u/--updaterev
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Thu, 05 Nov 2009 11:05:13 +0100 |
parents | 3bbc6bc62809 |
children | fe1b19bfe75b |
comparison
equal
deleted
inserted
replaced
9713:d193cc97c4e8 | 9714:2f1ab7f77ddc |
---|---|
588 basename of the source. | 588 basename of the source. |
589 | 589 |
590 The location of the source is added to the new repository's | 590 The location of the source is added to the new repository's |
591 .hg/hgrc file, as the default to be used for future pulls. | 591 .hg/hgrc file, as the default to be used for future pulls. |
592 | 592 |
593 If you use the -r/--rev option to clone up to a specific revision, | |
594 no subsequent revisions (including subsequent tags) will be | |
595 present in the cloned repository. This option implies --pull, even | |
596 on local repositories. | |
597 | |
598 By default, clone will check out the head of the 'default' branch. | |
599 If the -U/--noupdate option is used, the new clone will contain | |
600 only a repository (.hg) and no working copy (the working copy | |
601 parent is the null revision). | |
602 | |
603 See 'hg help urls' for valid source format details. | 593 See 'hg help urls' for valid source format details. |
604 | 594 |
605 It is possible to specify an ssh:// URL as the destination, but no | 595 It is possible to specify an ssh:// URL as the destination, but no |
606 .hg/hgrc and working directory will be created on the remote side. | 596 .hg/hgrc and working directory will be created on the remote side. |
607 Please see 'hg help urls' for important details about ssh:// URLs. | 597 Please see 'hg help urls' for important details about ssh:// URLs. |
598 | |
599 If the -U/--noupdate option is specified, the new clone will contain | |
600 only a repository (.hg) and no working copy (the working copy parent | |
601 will be the null changeset). Otherwise, clone will initially check | |
602 out (in order of precedence): :: | |
603 | |
604 a) the changeset, tag or branch specified with -u/--updaterev | |
605 b) the changeset, tag or branch given with the first -r/--rev | |
606 c) the head of the default branch | |
607 | |
608 Use 'hg clone -u . src dst' to checkout the source repository's | |
609 parent changeset (applicable for local source repositories only). | |
610 | |
611 A set of changesets (tags, or branch names) to pull may be specified | |
612 by listing each changeset (tag, or branch name) with -r/--rev. | |
613 If -r/--rev is used, the cloned repository will contain only a subset | |
614 of the changesets of the source repository. Only the set of changesets | |
615 defined by all -r/--rev options (including their direct and indirect | |
616 parent changesets) will be pulled into the destination repository. | |
617 No subsequent changesets (including subsequent tags) will be present | |
618 in the destination. | |
619 | |
620 Using -r/--rev (or 'clone src#rev dest') implies --pull, even for | |
621 local source repositories. | |
608 | 622 |
609 For efficiency, hardlinks are used for cloning whenever the source | 623 For efficiency, hardlinks are used for cloning whenever the source |
610 and destination are on the same filesystem (note this applies only | 624 and destination are on the same filesystem (note this applies only |
611 to the repository data, not to the checked out files). Some | 625 to the repository data, not to the checked out files). Some |
612 filesystems, such as AFS, implement hardlinking incorrectly, but | 626 filesystems, such as AFS, implement hardlinking incorrectly, but |
623 the operation is up to you) and you have to make sure your editor | 637 the operation is up to you) and you have to make sure your editor |
624 breaks hardlinks (Emacs and most Linux Kernel tools do so). Also, | 638 breaks hardlinks (Emacs and most Linux Kernel tools do so). Also, |
625 this is not compatible with certain extensions that place their | 639 this is not compatible with certain extensions that place their |
626 metadata under the .hg directory, such as mq. | 640 metadata under the .hg directory, such as mq. |
627 """ | 641 """ |
642 if opts.get('noupdate') and opts.get('updaterev'): | |
643 raise util.Abort(_("cannot specify both --noupdate and --updaterev")) | |
644 | |
628 hg.clone(cmdutil.remoteui(ui, opts), source, dest, | 645 hg.clone(cmdutil.remoteui(ui, opts), source, dest, |
629 pull=opts.get('pull'), | 646 pull=opts.get('pull'), |
630 stream=opts.get('uncompressed'), | 647 stream=opts.get('uncompressed'), |
631 rev=opts.get('rev'), | 648 rev=opts.get('rev'), |
632 update=not opts.get('noupdate')) | 649 update=opts.get('updaterev') or not opts.get('noupdate')) |
633 | 650 |
634 def commit(ui, repo, *pats, **opts): | 651 def commit(ui, repo, *pats, **opts): |
635 """commit the specified files or all outstanding changes | 652 """commit the specified files or all outstanding changes |
636 | 653 |
637 Commit changes to the given files into the repository. Unlike a | 654 Commit changes to the given files into the repository. Unlike a |
3353 _('[OPTION]... FILE...')), | 3370 _('[OPTION]... FILE...')), |
3354 "^clone": | 3371 "^clone": |
3355 (clone, | 3372 (clone, |
3356 [('U', 'noupdate', None, | 3373 [('U', 'noupdate', None, |
3357 _('the clone will only contain a repository (no working copy)')), | 3374 _('the clone will only contain a repository (no working copy)')), |
3375 ('u', 'updaterev', '', | |
3376 _('revision, tag or branch to check out')), | |
3358 ('r', 'rev', [], | 3377 ('r', 'rev', [], |
3359 _('a changeset you would like to have after cloning')), | 3378 _('a changeset you would like to have after cloning')), |
3360 ('', 'pull', None, _('use pull protocol to copy metadata')), | 3379 ('', 'pull', None, _('use pull protocol to copy metadata')), |
3361 ('', 'uncompressed', None, | 3380 ('', 'uncompressed', None, |
3362 _('use uncompressed transfer (fast over LAN)')), | 3381 _('use uncompressed transfer (fast over LAN)')), |