~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_fileid_involved.py

  • Committer: John Arbash Meinel
  • Date: 2006-01-19 21:25:01 UTC
  • mto: (1185.50.49 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1549.
  • Revision ID: john@arbash-meinel.com-20060119212501-cb28cf532a878c41
fileid_involved needs to unescape the file id and revision id

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        main_branch = Branch.initialize('.')
42
42
        self.build_tree(["a","b","c"])
43
43
 
44
 
        smart_add('.')
45
 
        commit(Branch.open("."), "Commit one", rev_id="rev-A")
 
44
        b = Branch.open('.')
 
45
        wt = b.working_tree()
 
46
        wt.add(['a', 'b', 'c'], ['a-file-id-2006-01-01-abcd',
 
47
                                 'b-file-id-2006-01-01-defg',
 
48
                                 'c-funky<file-id> quiji%bo'])
 
49
        commit(b, "Commit one", rev_id="rev-A")
 
50
        del b, wt
46
51
        #-------- end A -----------
47
52
 
48
53
        copy_branch(main_branch,"../branch1")
88
93
        os.chdir("../branch2")
89
94
 
90
95
        self.touch("c")
91
 
        smart_add('.')
92
96
        commit(Branch.open("."), "branch2, commit two", rev_id="rev-K")
93
97
 
94
98
        #-------- end K -----------
98
102
        self.touch("b")
99
103
        self.merge("../branch1",force=True)
100
104
 
101
 
        commit(Branch.open("."), "merge branch1, rev-12", rev_id="rev-D")
 
105
        # D gets some funky characters to make sure the unescaping works
 
106
        commit(Branch.open("."), "merge branch1, rev-12", rev_id="rev-<D>")
102
107
 
103
108
        # end D
104
109
 
125
130
        l = self.branch.fileid_involved_between_revs("rev-B","rev-K" )
126
131
        self.assertEquals( sorted(map( lambda x: x[0], l )), ["b","c"])
127
132
 
128
 
        l = self.branch.fileid_involved_between_revs("rev-C","rev-D" )
 
133
        l = self.branch.fileid_involved_between_revs("rev-C","rev-<D>" )
129
134
        self.assertEquals( sorted(map( lambda x: x[0], l )), ["b","d"])
130
135
 
131
136
        l = self.branch.fileid_involved_between_revs("rev-C","rev-G" )
140
145
        l = self.branch.fileid_involved_by_set(set(["rev-B"]))
141
146
        self.assertEquals( sorted(map( lambda x: x[0], l )), ["a"])
142
147
 
143
 
        l = self.branch.fileid_involved_by_set(set(["rev-D"]))
 
148
        l = self.branch.fileid_involved_by_set(set(["rev-<D>"]))
144
149
        self.assertEquals( sorted(map( lambda x: x[0], l )), ["b"])
145
150
 
146
151
    def test_fileid_involved_compare(self):
147
152
 
148
 
        l1 = self.branch.fileid_involved_between_revs("rev-E", "rev-D")
149
 
        l2 = self.branch.fileid_involved_by_set(set(["rev-D","rev-F","rev-C","rev-B"]))
 
153
        l1 = self.branch.fileid_involved_between_revs("rev-E", "rev-<D>")
 
154
        l2 = self.branch.fileid_involved_by_set(set(["rev-<D>","rev-F","rev-C","rev-B"]))
150
155
        self.assertEquals( l1, l2 )
151
156
 
152
157
        l1 = self.branch.fileid_involved_between_revs("rev-C", "rev-G")
153
158
        l2 = self.branch.fileid_involved_by_set(
154
 
            set(["rev-G","rev-D","rev-F","rev-K","rev-J"]))
 
159
            set(["rev-G","rev-<D>","rev-F","rev-K","rev-J"]))
155
160
        self.assertEquals( l1, l2 )
156
161
 
157
162
    def test_fileid_involved_full_compare(self):