/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: Martin Pool
  • Date: 2007-04-01 06:19:16 UTC
  • mfrom: (2323.5.20 0.15-integration)
  • mto: This revision was merged to the branch mainline in revision 2390.
  • Revision ID: mbp@sourcefrog.net-20070401061916-plpgsxdf8g7gll9o
Merge 0.15 final release back to trunk, including: recommend upgrades of old workingtrees, handle multiple http redirections, some dirstate fixes, 

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
    @display_command
219
219
    def run(self, revision_id=None, revision=None):
220
220
 
221
 
        revision_id = osutils.safe_revision_id(revision_id, warn=False)
222
221
        if revision_id is not None and revision is not None:
223
222
            raise errors.BzrCommandError('You can only supply one of'
224
223
                                         ' revision_id or --revision')
244
243
 
245
244
    Since a lightweight checkout is little more than a working tree
246
245
    this will refuse to run against one.
247
 
 
248
 
    To re-create the working tree, use "bzr checkout".
249
246
    """
250
247
 
251
248
    takes_args = ['location?']
341
338
 
342
339
    --file-ids-from will try to use the file ids from the supplied path.
343
340
    It looks up ids trying to find a matching parent directory with the
344
 
    same filename, and then by pure path. This option is rarely needed
345
 
    but can be useful when adding the same logical file into two
346
 
    branches that will be merged later (without showing the two different
347
 
    adds as a conflict). It is also useful when merging another project
348
 
    into a subdirectory of this one.
 
341
    same filename, and then by pure path.
349
342
    """
350
343
    takes_args = ['file*']
351
344
    takes_options = ['no-recurse', 'dry-run', 'verbose',
1921
1914
    given, try to find the format with the extension. If no extension
1922
1915
    is found exports to a directory (equivalent to --format=dir).
1923
1916
 
1924
 
    If root is supplied, it will be used as the root directory inside
1925
 
    container formats (tar, zip, etc). If it is not supplied it will default
1926
 
    to the exported filename. The root option has no effect for 'dir' format.
 
1917
    Root may be the top directory for tar, tgz and tbz2 formats. If none
 
1918
    is given, the top directory will be the root name of the file.
1927
1919
 
1928
1920
    If branch is omitted then the branch containing the current working
1929
1921
    directory will be used.
1930
1922
 
1931
 
    Note: Export of tree with non-ASCII filenames to zip is not supported.
 
1923
    Note: export of tree with non-ascii filenames to zip is not supported.
1932
1924
 
1933
1925
     Supported formats       Autodetected by extension
1934
1926
     -----------------       -------------------------
2036
2028
    within it is committed.
2037
2029
 
2038
2030
    A selected-file commit may fail in some cases where the committed
2039
 
    tree would be invalid. Consider::
2040
 
 
2041
 
      bzr init foo
2042
 
      mkdir foo/bar
2043
 
      bzr add foo/bar
2044
 
      bzr commit foo -m "committing foo"
2045
 
      bzr mv foo/bar foo/baz
2046
 
      mkdir foo/bar
2047
 
      bzr add foo/bar
2048
 
      bzr commit foo/bar -m "committing bar but not baz"
2049
 
 
2050
 
    In the example above, the last commit will fail by design. This gives
2051
 
    the user the opportunity to decide whether they want to commit the
2052
 
    rename at the same time, separately first, or not at all. (As a general
2053
 
    rule, when in doubt, Bazaar has a policy of Doing the Safe Thing.)
2054
 
 
2055
 
    Note: A selected-file commit after a merge is not yet supported.
 
2031
    tree would be invalid, such as trying to commit a file in a
 
2032
    newly-added directory that is not itself committed.
2056
2033
    """
2057
2034
    # TODO: Run hooks on tree to-be-committed, and after commit.
2058
2035
 
2317
2294
    hidden = True
2318
2295
    takes_args = ['testspecs*']
2319
2296
    takes_options = ['verbose',
2320
 
                     Option('one',
2321
 
                             help='stop when one test fails',
2322
 
                             short_name='1',
2323
 
                             ),
 
2297
                     Option('one', help='stop when one test fails'),
2324
2298
                     Option('keep-output',
2325
2299
                            help='keep output directories when tests fail'),
2326
2300
                     Option('transport',
2338
2312
                            help='clean temporary tests directories'
2339
2313
                                 ' without running tests'),
2340
2314
                     Option('first',
2341
 
                            help='run all tests, but run specified tests first',
2342
 
                            short_name='f',
 
2315
                            help='run all tests, but run specified tests first'
2343
2316
                            ),
2344
2317
                     Option('numbered-dirs',
2345
2318
                            help='use numbered dirs for TestCaseInTempDir'),
2480
2453
 
2481
2454
    Examples:
2482
2455
 
2483
 
    To merge the latest revision from bzr.dev:
2484
 
        bzr merge ../bzr.dev
 
2456
    To merge the latest revision from bzr.dev
 
2457
    bzr merge ../bzr.dev
2485
2458
 
2486
 
    To merge changes up to and including revision 82 from bzr.dev:
2487
 
        bzr merge -r 82 ../bzr.dev
 
2459
    To merge changes up to and including revision 82 from bzr.dev
 
2460
    bzr merge -r 82 ../bzr.dev
2488
2461
 
2489
2462
    To merge the changes introduced by 82, without previous changes:
2490
 
        bzr merge -r 81..82 ../bzr.dev
 
2463
    bzr merge -r 81..82 ../bzr.dev
2491
2464
    
2492
2465
    merge refuses to run if there are any uncommitted changes, unless
2493
2466
    --force is given.
2659
2632
    pending merge, and it lets you specify particular files.
2660
2633
 
2661
2634
    Examples:
2662
 
 
2663
2635
    $ bzr remerge --show-base
2664
2636
        Re-do the merge of all conflicted files, and show the base text in
2665
2637
        conflict regions, in addition to the usual THIS and OTHER texts.
3252
3224
        ]
3253
3225
 
3254
3226
    def run(self, port=None, inet=False, directory=None, allow_writes=False):
3255
 
        from bzrlib.smart import server, medium
 
3227
        from bzrlib.transport import smart
3256
3228
        from bzrlib.transport import get_transport
3257
 
        from bzrlib.transport.remote import BZR_DEFAULT_PORT
3258
3229
        if directory is None:
3259
3230
            directory = os.getcwd()
3260
3231
        url = urlutils.local_path_to_url(directory)
3262
3233
            url = 'readonly+' + url
3263
3234
        t = get_transport(url)
3264
3235
        if inet:
3265
 
            smart_server = medium.SmartServerPipeStreamMedium(
3266
 
                sys.stdin, sys.stdout, t)
 
3236
            server = smart.SmartServerPipeStreamMedium(sys.stdin, sys.stdout, t)
3267
3237
        else:
3268
3238
            if port is None:
3269
 
                port = BZR_DEFAULT_PORT
 
3239
                port = smart.BZR_DEFAULT_PORT
3270
3240
                host = '127.0.0.1'
3271
3241
            else:
3272
3242
                if ':' in port:
3274
3244
                else:
3275
3245
                    host = '127.0.0.1'
3276
3246
                port = int(port)
3277
 
            smart_server = server.SmartTCPServer(t, host=host, port=port)
3278
 
            print 'listening on port: ', smart_server.port
 
3247
            server = smart.SmartTCPServer(t, host=host, port=port)
 
3248
            print 'listening on port: ', server.port
3279
3249
            sys.stdout.flush()
3280
 
        smart_server.serve()
 
3250
        server.serve()
3281
3251
 
3282
3252
class cmd_join(Command):
3283
3253
    """Combine a subtree into its containing tree.