/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: John Arbash Meinel
  • Date: 2005-10-27 02:38:47 UTC
  • mto: (1185.31.5)
  • mto: This revision was merged to the branch mainline in revision 1506.
  • Revision ID: john@arbash-meinel.com-20051027023847-a3dc4032752a2085
Refactor pull --verbose into a log.py function, add tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
372
372
                new_rh = br_to.revision_history()
373
373
                if old_rh != new_rh:
374
374
                    # Something changed
375
 
                    from bzrlib.log import log_formatter, show_log
376
 
                    import codecs
377
 
                    outf = codecs.getwriter(bzrlib.user_encoding)(sys.stdout, errors='replace')
378
 
                    lf = log_formatter('long',
379
 
                                       show_ids=False,
380
 
                                       to_file=outf,
381
 
                                       show_timezone='original')
382
 
 
383
 
                    # This is the first index which is different between
384
 
                    # old and new
385
 
                    base_idx = None
386
 
                    for i in xrange(max(len(new_rh),
387
 
                                        len(old_rh))):
388
 
                        if (len(new_rh) <= i
389
 
                            or len(old_rh) <= i
390
 
                            or new_rh[i] != old_rh[i]):
391
 
                            base_idx = i
392
 
                            break
393
 
 
394
 
                    if base_idx is None:
395
 
                        print 'Nothing seems to have changed'
396
 
                    else:
397
 
                        if base_idx < len(old_rh):
398
 
                            print '*'*60
399
 
                            print 'Removed Revisions:'
400
 
                            for i in range(base_idx, len(old_rh)):
401
 
                                rev = br_to.get_revision(old_rh[i])
402
 
                                lf.show(i+1, rev, None)
403
 
                            print '*'*60
404
 
                        if base_idx < len(new_rh):
405
 
                            print 'Added Revisions:'
406
 
                            show_log(br_to,
407
 
                                     lf,
408
 
                                     None,
409
 
                                     verbose=True,
410
 
                                     direction='forward',
411
 
                                     start_revision=base_idx+1,
412
 
                                     end_revision=len(new_rh),
413
 
                                     search=None)
414
 
 
415
 
                    
 
375
                    from bzrlib.log import show_changed_revisions
 
376
                    show_changed_revisions(br_to, old_rh, new_rh)
416
377
 
417
378
 
418
379
class cmd_branch(Command):