~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2005-11-13 18:57:26 UTC
  • mfrom: (1185.31.9)
  • Revision ID: robertc@robertcollins.net-20051113185726-39ede10d746eee6d
Merge Johns current integration work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
        
238
238
        for d in dir_list:
239
239
            os.mkdir(d)
240
 
            if not b:
241
 
                b = Branch.open_containing(d)[0]
242
 
            b.add([d])
 
240
            b, dd = Branch.open_containing(d)
 
241
            b.add([dd])
243
242
            print 'added', d
244
243
 
245
244
 
363
362
    If you want to forget your local changes and just update your branch to
364
363
    match the remote one, use --overwrite.
365
364
    """
366
 
    takes_options = ['remember', 'overwrite']
 
365
    takes_options = ['remember', 'overwrite', 'verbose']
367
366
    takes_args = ['location?']
368
367
 
369
 
    def run(self, location=None, remember=False, overwrite=False):
 
368
    def run(self, location=None, remember=False, overwrite=False, verbose=False):
370
369
        from bzrlib.merge import merge
371
370
        from shutil import rmtree
372
371
        import errno
381
380
                location = stored_loc
382
381
        br_from = Branch.open(location)
383
382
        try:
 
383
            old_rh = br_to.revision_history()
384
384
            br_to.working_tree().pull(br_from, overwrite)
385
385
        except DivergedBranches:
386
386
            raise BzrCommandError("These branches have diverged."
388
388
        if br_to.get_parent() is None or remember:
389
389
            br_to.set_parent(location)
390
390
 
 
391
        if verbose:
 
392
            new_rh = br_to.revision_history()
 
393
            if old_rh != new_rh:
 
394
                # Something changed
 
395
                from bzrlib.log import show_changed_revisions
 
396
                show_changed_revisions(br_to, old_rh, new_rh)
 
397
 
391
398
 
392
399
class cmd_push(Command):
393
400
    """Push this branch into another branch.
419
426
    takes_args = ['location?']
420
427
 
421
428
    def run(self, location=None, remember=False, overwrite=False,
422
 
            create_prefix=False):
 
429
            create_prefix=False, verbose=False):
423
430
        import errno
424
431
        from shutil import rmtree
425
432
        from bzrlib.transport import get_transport
462
469
            NoSuchFile
463
470
            br_to = Branch.initialize(location)
464
471
        try:
 
472
            old_rh = br_to.revision_history()
465
473
            br_to.pull(br_from, overwrite)
466
474
        except DivergedBranches:
467
475
            raise BzrCommandError("These branches have diverged."
469
477
        if br_from.get_push_location() is None or remember:
470
478
            br_from.set_push_location(location)
471
479
 
 
480
        if verbose:
 
481
            new_rh = br_to.revision_history()
 
482
            if old_rh != new_rh:
 
483
                # Something changed
 
484
                from bzrlib.log import show_changed_revisions
 
485
                show_changed_revisions(br_to, old_rh, new_rh)
472
486
 
473
487
class cmd_branch(Command):
474
488
    """Create a new copy of a branch.
878
892
        if rev2 == 0:
879
893
            rev2 = None
880
894
 
881
 
        mutter('encoding log as %r' % bzrlib.user_encoding)
 
895
        mutter('encoding log as %r', bzrlib.user_encoding)
882
896
 
883
897
        # use 'replace' so that we don't abort if trying to write out
884
898
        # in e.g. the default C locale.