~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_diff.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-05 10:27:33 UTC
  • mto: (5008.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5009.
  • Revision ID: v.ladeuil+lp@free.fr-20100205102733-8wpjnqz6g4nvrbfu
All Conflict action method names start with 'action_' to avoid potential namespace collisions

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
45
45
from bzrlib.revisiontree import RevisionTree
46
46
from bzrlib.revisionspec import RevisionSpec
47
47
 
48
 
from bzrlib.tests.test_win32utils import BackslashDirSeparatorFeature
49
 
 
50
48
 
51
49
class _AttribFeature(Feature):
52
50
 
1294
1292
            diff_obj.command_template)
1295
1293
 
1296
1294
    def test_from_string_u5(self):
1297
 
        diff_obj = DiffFromTool.from_string('diff "-u 5"', None, None, None)
 
1295
        diff_obj = DiffFromTool.from_string('diff -u\\ 5', None, None, None)
1298
1296
        self.addCleanup(diff_obj.finish)
1299
1297
        self.assertEqual(['diff', '-u 5', '@old_path', '@new_path'],
1300
1298
                         diff_obj.command_template)
1301
1299
        self.assertEqual(['diff', '-u 5', 'old-path', 'new-path'],
1302
1300
                         diff_obj._get_command('old-path', 'new-path'))
1303
 
        
1304
 
    def test_from_string_path_with_backslashes(self):
1305
 
        self.requireFeature(BackslashDirSeparatorFeature)
1306
 
        tool = 'C:\\Tools\\Diff.exe'
1307
 
        diff_obj = DiffFromTool.from_string(tool, None, None, None)
1308
 
        self.addCleanup(diff_obj.finish)
1309
 
        self.assertEqual(['C:\\Tools\\Diff.exe', '@old_path', '@new_path'],
1310
 
                         diff_obj.command_template)
1311
 
        self.assertEqual(['C:\\Tools\\Diff.exe', 'old-path', 'new-path'],
1312
 
                         diff_obj._get_command('old-path', 'new-path'))
1313
1301
 
1314
1302
    def test_execute(self):
1315
1303
        output = StringIO()