~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_log.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-07-12 15:43:28 UTC
  • mfrom: (6022.1.4 bzr-log-author)
  • Revision ID: pqm@pqm.ubuntu.com-20110712154328-y17bvllaw2rh0997
(jr) bzr log -m now matches message, author, committer and bugs instead
 of just matching the message.  --message keeps its original meaning,
 while --match-message, --match-author, --match-committer and
 --match-bugs match each of those fields. (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
974
974
 
975
975
    def test_log_range_open_end(self):
976
976
        self.assertLogRevnos(["-r1.."], ["2", "1"])
 
977
 
 
978
class TestLogMatch(TestLogWithLogCatcher):
 
979
    def prepare_tree(self):
 
980
        tree = self.make_branch_and_tree('')
 
981
        self.build_tree(
 
982
            ['/hello.txt', '/goodbye.txt'])
 
983
        tree.add('hello.txt')
 
984
        tree.commit(message='message1', committer='committer1', authors=['author1'])
 
985
        tree.add('goodbye.txt')
 
986
        tree.commit(message='message2', committer='committer2', authors=['author2'])
 
987
    
 
988
    def test_message(self):
 
989
        self.prepare_tree()
 
990
        self.assertLogRevnos(["-m", "message1"], ["1"])
 
991
        self.assertLogRevnos(["-m", "message2"], ["2"])
 
992
        self.assertLogRevnos(["-m", "message"], ["2", "1"])
 
993
        self.assertLogRevnos(["-m", "message1", "-m", "message2"], ["2", "1"])
 
994
        self.assertLogRevnos(["--match-message", "message1"], ["1"])
 
995
        self.assertLogRevnos(["--match-message", "message2"], ["2"])
 
996
        self.assertLogRevnos(["--match-message", "message"], ["2", "1"])
 
997
        self.assertLogRevnos(["--match-message", "message1", 
 
998
                              "--match-message", "message2"], ["2", "1"])
 
999
        self.assertLogRevnos(["--message", "message1"], ["1"])
 
1000
        self.assertLogRevnos(["--message", "message2"], ["2"])
 
1001
        self.assertLogRevnos(["--message", "message"], ["2", "1"])
 
1002
        self.assertLogRevnos(["--match-message", "message1", 
 
1003
                              "--message", "message2"], ["2", "1"])
 
1004
        self.assertLogRevnos(["--message", "message1", 
 
1005
                              "--match-message", "message2"], ["2", "1"])
 
1006
 
 
1007
    def test_committer(self):
 
1008
        self.prepare_tree()
 
1009
        self.assertLogRevnos(["-m", "committer1"], ["1"])
 
1010
        self.assertLogRevnos(["-m", "committer2"], ["2"])
 
1011
        self.assertLogRevnos(["-m", "committer"], ["2", "1"])
 
1012
        self.assertLogRevnos(["-m", "committer1", "-m", "committer2"], 
 
1013
                             ["2", "1"])
 
1014
        self.assertLogRevnos(["--match-committer", "committer1"], ["1"])
 
1015
        self.assertLogRevnos(["--match-committer", "committer2"], ["2"])
 
1016
        self.assertLogRevnos(["--match-committer", "committer"], ["2", "1"])
 
1017
        self.assertLogRevnos(["--match-committer", "committer1", 
 
1018
                              "--match-committer", "committer2"], ["2", "1"])
 
1019
 
 
1020
    def test_author(self):
 
1021
        self.prepare_tree()
 
1022
        self.assertLogRevnos(["-m", "author1"], ["1"])
 
1023
        self.assertLogRevnos(["-m", "author2"], ["2"])
 
1024
        self.assertLogRevnos(["-m", "author"], ["2", "1"])
 
1025
        self.assertLogRevnos(["-m", "author1", "-m", "author2"], 
 
1026
                             ["2", "1"])
 
1027
        self.assertLogRevnos(["--match-author", "author1"], ["1"])
 
1028
        self.assertLogRevnos(["--match-author", "author2"], ["2"])
 
1029
        self.assertLogRevnos(["--match-author", "author"], ["2", "1"])
 
1030
        self.assertLogRevnos(["--match-author", "author1", 
 
1031
                              "--match-author", "author2"], ["2", "1"])