~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-30 06:40:22 UTC
  • mfrom: (2387.1.2 unbasis)
  • Revision ID: pqm@pqm.ubuntu.com-20070330064022-bdce9356befc3795
(robertc) Remove the --basis parameter to clone etc. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
835
835
 
836
836
    To retrieve the branch as of a particular revision, supply the --revision
837
837
    parameter, as in "branch foo/bar -r 5".
838
 
 
839
 
    --basis is to speed up branching from remote branches.  When specified, it
840
 
    copies all the file-contents, inventory and revision data from the basis
841
 
    branch before copying anything from the remote branch.
842
838
    """
843
839
    takes_args = ['from_location', 'to_location?']
844
 
    takes_options = ['revision', 'basis']
 
840
    takes_options = ['revision']
845
841
    aliases = ['get', 'clone']
846
842
 
847
 
    def run(self, from_location, to_location=None, revision=None, basis=None):
 
843
    def run(self, from_location, to_location=None, revision=None):
848
844
        from bzrlib.tag import _merge_tags_if_possible
849
845
        if revision is None:
850
846
            revision = [None]
855
851
        br_from = Branch.open(from_location)
856
852
        br_from.lock_read()
857
853
        try:
858
 
            if basis is not None:
859
 
                basis_dir = bzrdir.BzrDir.open_containing(basis)[0]
860
 
            else:
861
 
                basis_dir = None
862
854
            if len(revision) == 1 and revision[0] is not None:
863
855
                revision_id = revision[0].in_history(br_from)[1]
864
856
            else:
883
875
                                             % to_location)
884
876
            try:
885
877
                # preserve whatever source format we have.
886
 
                dir = br_from.bzrdir.sprout(to_transport.base,
887
 
                        revision_id, basis_dir)
 
878
                dir = br_from.bzrdir.sprout(to_transport.base, revision_id)
888
879
                branch = dir.open_branch()
889
880
            except errors.NoSuchRevision:
890
881
                to_transport.delete_tree('.')
891
882
                msg = "The branch %s has no revision %s." % (from_location, revision[0])
892
883
                raise errors.BzrCommandError(msg)
893
 
            except errors.UnlistableBranch:
894
 
                osutils.rmtree(to_location)
895
 
                msg = "The branch %s cannot be used as a --basis" % (basis,)
896
 
                raise errors.BzrCommandError(msg)
897
884
            if name:
898
885
                branch.control_files.put_utf8('branch-name', name)
899
886
            _merge_tags_if_possible(br_from, branch)
921
908
    See "help checkouts" for more information on checkouts.
922
909
    """
923
910
    takes_args = ['branch_location?', 'to_location?']
924
 
    takes_options = ['revision', # , 'basis']
 
911
    takes_options = ['revision',
925
912
                     Option('lightweight',
926
913
                            help="perform a lightweight checkout. Lightweight "
927
914
                                 "checkouts depend on access to the branch for "
932
919
                     ]
933
920
    aliases = ['co']
934
921
 
935
 
    def run(self, branch_location=None, to_location=None, revision=None, basis=None,
 
922
    def run(self, branch_location=None, to_location=None, revision=None,
936
923
            lightweight=False):
937
924
        if revision is None:
938
925
            revision = [None]