/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2007-04-01 04:06:14 UTC
  • mfrom: (2388 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2389.
  • Revision ID: aaron.bentley@utoronto.ca-20070401040614-3f0tytdrc2jtv8f6
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
    unknown
149
149
        Not versioned and not matching an ignore pattern.
150
150
 
151
 
    To see ignored files use 'bzr ignored'.  For details in the
 
151
    To see ignored files use 'bzr ignored'.  For details on the
152
152
    changes to file texts, use 'bzr diff'.
153
153
    
154
154
    --short gives a status flags for each item, similar to the SVN's status
183
183
    # TODO: --no-recurse, --recurse options
184
184
    
185
185
    takes_args = ['file*']
186
 
    takes_options = ['show-ids', 'revision', 'short',
 
186
    takes_options = ['show-ids', 'revision',
 
187
                     Option('short', help='Give short SVN-style status lines'),
187
188
                     Option('versioned', help='Only show versioned files')]
188
189
    aliases = ['st', 'stat']
189
190
 
839
840
 
840
841
    To retrieve the branch as of a particular revision, supply the --revision
841
842
    parameter, as in "branch foo/bar -r 5".
842
 
 
843
 
    --basis is to speed up branching from remote branches.  When specified, it
844
 
    copies all the file-contents, inventory and revision data from the basis
845
 
    branch before copying anything from the remote branch.
846
843
    """
847
844
    takes_args = ['from_location', 'to_location?']
848
 
    takes_options = ['revision', 'basis']
 
845
    takes_options = ['revision']
849
846
    aliases = ['get', 'clone']
850
847
 
851
 
    def run(self, from_location, to_location=None, revision=None, basis=None):
 
848
    def run(self, from_location, to_location=None, revision=None):
852
849
        from bzrlib.tag import _merge_tags_if_possible
853
850
        if revision is None:
854
851
            revision = [None]
859
856
        br_from = Branch.open(from_location)
860
857
        br_from.lock_read()
861
858
        try:
862
 
            if basis is not None:
863
 
                basis_dir = bzrdir.BzrDir.open_containing(basis)[0]
864
 
            else:
865
 
                basis_dir = None
866
859
            if len(revision) == 1 and revision[0] is not None:
867
860
                revision_id = revision[0].in_history(br_from)[1]
868
861
            else:
887
880
                                             % to_location)
888
881
            try:
889
882
                # preserve whatever source format we have.
890
 
                dir = br_from.bzrdir.sprout(to_transport.base,
891
 
                        revision_id, basis_dir)
 
883
                dir = br_from.bzrdir.sprout(to_transport.base, revision_id)
892
884
                branch = dir.open_branch()
893
885
            except errors.NoSuchRevision:
894
886
                to_transport.delete_tree('.')
895
887
                msg = "The branch %s has no revision %s." % (from_location, revision[0])
896
888
                raise errors.BzrCommandError(msg)
897
 
            except errors.UnlistableBranch:
898
 
                osutils.rmtree(to_location)
899
 
                msg = "The branch %s cannot be used as a --basis" % (basis,)
900
 
                raise errors.BzrCommandError(msg)
901
889
            if name:
902
890
                branch.control_files.put_utf8('branch-name', name)
903
891
            _merge_tags_if_possible(br_from, branch)
922
910
    out of date [so you cannot commit] but it may be useful (i.e. to examine old
923
911
    code.)
924
912
 
925
 
    --basis is to speed up checking out from remote branches.  When specified, it
926
 
    uses the inventory and file contents from the basis branch in preference to the
927
 
    branch being checked out.
928
 
 
929
913
    See "help checkouts" for more information on checkouts.
930
914
    """
931
915
    takes_args = ['branch_location?', 'to_location?']
932
 
    takes_options = ['revision', # , 'basis']
 
916
    takes_options = ['revision',
933
917
                     Option('lightweight',
934
918
                            help="perform a lightweight checkout. Lightweight "
935
919
                                 "checkouts depend on access to the branch for "
940
924
                     ]
941
925
    aliases = ['co']
942
926
 
943
 
    def run(self, branch_location=None, to_location=None, revision=None, basis=None,
 
927
    def run(self, branch_location=None, to_location=None, revision=None,
944
928
            lightweight=False):
945
929
        if revision is None:
946
930
            revision = [None]
1218
1202
 
1219
1203
    If there is a repository in a parent directory of the location, then 
1220
1204
    the history of the branch will be stored in the repository.  Otherwise
1221
 
    init creates a standalone branch which carries its own history in 
1222
 
    .bzr.
 
1205
    init creates a standalone branch which carries its own history
 
1206
    in the .bzr directory.
1223
1207
 
1224
1208
    If there is already a branch at the location but it has no working tree,
1225
1209
    the tree can be populated with 'bzr checkout'.
1292
1276
    """Create a shared repository to hold branches.
1293
1277
 
1294
1278
    New branches created under the repository directory will store their revisions
1295
 
    in the repository, not in the branch directory, if the branch format supports
1296
 
    shared storage.
 
1279
    in the repository, not in the branch directory.
1297
1280
 
1298
1281
    example:
1299
1282
        bzr init-repo --no-trees repo
1312
1295
                            value_switches=True, title='Repository format'),
1313
1296
                     Option('no-trees',
1314
1297
                             help='Branches in the repository will default to'
1315
 
                                  'not having a working tree'),
 
1298
                                  ' not having a working tree'),
1316
1299
                    ]
1317
1300
    aliases = ["init-repo"]
1318
1301
 
1923
1906
 
1924
1907
 
1925
1908
class cmd_export(Command):
1926
 
    """Export past revision to destination directory.
 
1909
    """Export current or past revision to a destination directory or archive.
1927
1910
 
1928
1911
    If no revision is specified this exports the last committed revision.
1929
1912
 
1934
1917
    Root may be the top directory for tar, tgz and tbz2 formats. If none
1935
1918
    is given, the top directory will be the root name of the file.
1936
1919
 
1937
 
    If branch is omitted then the branch containing the CWD will be used.
 
1920
    If branch is omitted then the branch containing the current working
 
1921
    directory will be used.
1938
1922
 
1939
1923
    Note: export of tree with non-ascii filenames to zip is not supported.
1940
1924
 
1972
1956
 
1973
1957
 
1974
1958
class cmd_cat(Command):
1975
 
    """Write a file's text from a previous revision."""
 
1959
    """Write the contents of a file as of a given revision to standard output.
 
1960
 
 
1961
    If no revision is nominated, the last revision is used.
 
1962
 
 
1963
    Note: Take care to redirect standard output when using this command on a
 
1964
    binary file. 
 
1965
    """
1976
1966
 
1977
1967
    takes_options = ['revision', 'name-from-revision']
1978
1968
    takes_args = ['filename']
2245
2235
 
2246
2236
    @display_command
2247
2237
    def printme(self, branch):
2248
 
        print branch.nick 
 
2238
        print branch.nick
2249
2239
 
2250
2240
 
2251
2241
class cmd_selftest(Command):
2474
2464
    
2475
2465
    merge refuses to run if there are any uncommitted changes, unless
2476
2466
    --force is given.
2477
 
 
2478
 
    The following merge types are available:
2479
2467
    """
2480
2468
    takes_args = ['branch?']
2481
2469
    takes_options = ['revision', 'force', 'merge-type', 'reprocess', 'remember',
2651
2639
    $ bzr remerge --merge-type weave --reprocess foobar
2652
2640
        Re-do the merge of "foobar", using the weave merge algorithm, with
2653
2641
        additional processing to reduce the size of conflict regions.
2654
 
    
2655
 
    The following merge types are available:"""
 
2642
    """
2656
2643
    takes_args = ['file*']
2657
2644
    takes_options = ['merge-type', 'reprocess',
2658
2645
                     Option('show-base', help="Show base revision text in "
2744
2731
    """
2745
2732
    takes_options = ['revision', 'no-backup']
2746
2733
    takes_args = ['file*']
2747
 
    aliases = ['merge-revert']
2748
2734
 
2749
2735
    def run(self, revision=None, no_backup=False, file_list=None):
2750
2736
        if file_list is not None: