~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: mbp at sourcefrog
  • Date: 2005-04-04 09:50:24 UTC
  • Revision ID: mbp@sourcefrog.net-20050404095024-4646dbcc42eada9e
workaround for python2.3 difflib bug

Show diffs side-by-side

added added

removed removed

Lines of Context:
321
321
        # FIXME: Something about the diff format makes patch unhappy
322
322
        # with newly-added files.
323
323
 
324
 
        def diffit(*a, **kw):
325
 
            sys.stdout.writelines(difflib.unified_diff(*a, **kw))
 
324
        def diffit(oldlines, newlines, **kw):
 
325
            # FIXME: difflib is wrong if there is no trailing newline.
 
326
 
 
327
            # Special workaround for Python2.3, where difflib fails if
 
328
            # both sequences are empty.
 
329
            if oldlines or newlines:
 
330
                sys.stdout.writelines(difflib.unified_diff(oldlines, newlines, **kw))
326
331
            print
327
332
        
328
333
        if file_state in ['.', '?', 'I']: