/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 breezy/tests/test_grep.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-02 22:31:28 UTC
  • mfrom: (7291 work)
  • mto: This revision was merged to the branch mainline in revision 7293.
  • Revision ID: jelmer@jelmer.uk-20190302223128-0qk1i5tozmzq5nyq
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
from __future__ import absolute_import
18
18
 
20
20
import re
21
21
import unicodedata as ud
22
22
 
23
 
from ... import tests, osutils
24
 
from ...sixish import PY3
25
 
from ..._termcolor import color_string, FG
 
23
from .. import tests, osutils
 
24
from ..sixish import PY3
 
25
from .._termcolor import color_string, FG
26
26
 
27
 
from ...tests.features import (
 
27
from ..tests.features import (
28
28
    UnicodeFilenameFeature,
29
29
    )
30
30
 
2429
2429
        self.assertEqualDiff(subst_dates(out), '''\
2430
2430
=== revno:3 ===
2431
2431
  === modified file 'hello'
2432
 
    --- hello   YYYY-MM-DD HH:MM:SS +ZZZZ
2433
 
    +++ hello   YYYY-MM-DD HH:MM:SS +ZZZZ
 
2432
    --- hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
 
2433
    +++ hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
2434
2434
    +hello world!
2435
2435
=== revno:1 ===
2436
2436
  === added file 'hello'
2437
 
    --- hello   YYYY-MM-DD HH:MM:SS +ZZZZ
2438
 
    +++ hello   YYYY-MM-DD HH:MM:SS +ZZZZ
 
2437
    --- hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
 
2438
    +++ hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
2439
2439
''')
2440
2440
 
2441
2441
    def test_grep_diff_revision(self):
2448
2448
        self.assertEqualDiff(subst_dates(out), '''\
2449
2449
=== revno:3 ===
2450
2450
  === modified file 'hello'
2451
 
    --- hello   YYYY-MM-DD HH:MM:SS +ZZZZ
2452
 
    +++ hello   YYYY-MM-DD HH:MM:SS +ZZZZ
 
2451
    --- hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
 
2452
    +++ hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
2453
2453
    +hello world!
2454
2454
''')
2455
2455
 
2470
2470
        self.assertEqualDiff(subst_dates(out), '''\
2471
2471
=== revno:5 ===
2472
2472
  === modified file 'hello'
2473
 
    --- hello   YYYY-MM-DD HH:MM:SS +ZZZZ
2474
 
    +++ hello   YYYY-MM-DD HH:MM:SS +ZZZZ
 
2473
    --- hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
 
2474
    +++ hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
2475
2475
    +hello world!3
2476
2476
=== revno:4 ===
2477
2477
  === added file 'blah'
2478
2478
    +hello world!2
2479
2479
=== revno:3 ===
2480
2480
  === modified file 'hello'
2481
 
    --- hello   YYYY-MM-DD HH:MM:SS +ZZZZ
2482
 
    +++ hello   YYYY-MM-DD HH:MM:SS +ZZZZ
 
2481
    --- hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
 
2482
    +++ hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
2483
2483
    +hello world!1
2484
2484
''')
2485
2485
 
2496
2496
            "  === modified file 'hello'", fg=FG.BOLD_MAGENTA) + '\n'
2497
2497
        redhello = color_string('hello', fg=FG.BOLD_RED)
2498
2498
        diffstr = '''\
2499
 
    --- hello   YYYY-MM-DD HH:MM:SS +ZZZZ
2500
 
    +++ hello   YYYY-MM-DD HH:MM:SS +ZZZZ
 
2499
    --- hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
 
2500
    +++ hello\tYYYY-MM-DD HH:MM:SS +ZZZZ
2501
2501
    +hello world!
2502
2502
'''
2503
2503
        diffstr = diffstr.replace('hello', redhello)