~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_version_info.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-15 16:32:29 UTC
  • mfrom: (1731.1.67 unique-root)
  • Revision ID: pqm@pqm.ubuntu.com-20061015163229-648b1f2ebe692136
New trees have unique root ids

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        self.assertEqual(['False'], stanza.get_all('clean'))
113
113
 
114
114
        file_rev_stanza = get_one_stanza(stanza, 'file-revisions')
115
 
        self.assertEqual(['a', 'b', 'c'], file_rev_stanza.get_all('path'))
116
 
        self.assertEqual(['r3', 'r2', 'unversioned'],
 
115
        self.assertEqual(['', 'a', 'b', 'c'], file_rev_stanza.get_all('path'))
 
116
        self.assertEqual(['r3', 'r3', 'r2', 'unversioned'],
117
117
            file_rev_stanza.get_all('revision'))
118
118
        os.remove('branch/c')
119
119
 
129
129
        wt.rename_one('b', 'd')
130
130
        stanza = regen(check_for_clean=True, include_file_revisions=True)
131
131
        file_rev_stanza = get_one_stanza(stanza, 'file-revisions')
132
 
        self.assertEqual(['a', 'b', 'c', 'd'], file_rev_stanza.get_all('path'))
133
 
        self.assertEqual(['modified', 'renamed to d', 'new', 'renamed from b'],
 
132
        self.assertEqual(['', 'a', 'b', 'c', 'd'], 
 
133
                          file_rev_stanza.get_all('path'))
 
134
        self.assertEqual(['r3', 'modified', 'renamed to d', 'new', 
 
135
                          'renamed from b'],
134
136
                         file_rev_stanza.get_all('revision'))
135
137
 
136
138
        wt.commit('modified', rev_id='r4')
138
140
        os.remove('branch/d')
139
141
        stanza = regen(check_for_clean=True, include_file_revisions=True)
140
142
        file_rev_stanza = get_one_stanza(stanza, 'file-revisions')
141
 
        self.assertEqual(['a', 'c', 'd'], file_rev_stanza.get_all('path'))
142
 
        self.assertEqual(['r4', 'unversioned', 'removed'],
 
143
        self.assertEqual(['', 'a', 'c', 'd'], file_rev_stanza.get_all('path'))
 
144
        self.assertEqual(['r4', 'r4', 'unversioned', 'removed'],
143
145
                         file_rev_stanza.get_all('revision'))
144
146
 
145
147
    def test_python_version(self):
182
184
        self.build_tree(['branch/c'])
183
185
        tvi = regen(check_for_clean=True, include_file_revisions=True)
184
186
        self.assertEqual(False, tvi.version_info['clean'])
185
 
        self.assertEqual(['a', 'b', 'c'], sorted(tvi.file_revisions.keys()))
 
187
        self.assertEqual(['', 'a', 'b', 'c'], 
 
188
                         sorted(tvi.file_revisions.keys()))
186
189
        self.assertEqual('r3', tvi.file_revisions['a'])
187
190
        self.assertEqual('r2', tvi.file_revisions['b'])
188
191
        self.assertEqual('unversioned', tvi.file_revisions['c'])
199
202
        wt.add('c')
200
203
        wt.rename_one('b', 'd')
201
204
        tvi = regen(check_for_clean=True, include_file_revisions=True)
202
 
        self.assertEqual(['a', 'b', 'c', 'd'], sorted(tvi.file_revisions.keys()))
 
205
        self.assertEqual(['', 'a', 'b', 'c', 'd'], 
 
206
                          sorted(tvi.file_revisions.keys()))
203
207
        self.assertEqual('modified', tvi.file_revisions['a'])
204
208
        self.assertEqual('renamed to d', tvi.file_revisions['b'])
205
209
        self.assertEqual('new', tvi.file_revisions['c'])
209
213
        wt.remove(['c', 'd'])
210
214
        os.remove('branch/d')
211
215
        tvi = regen(check_for_clean=True, include_file_revisions=True)
212
 
        self.assertEqual(['a', 'c', 'd'], sorted(tvi.file_revisions.keys()))
 
216
        self.assertEqual(['', 'a', 'c', 'd'], 
 
217
                          sorted(tvi.file_revisions.keys()))
213
218
        self.assertEqual('r4', tvi.file_revisions['a'])
214
219
        self.assertEqual('unversioned', tvi.file_revisions['c'])
215
220
        self.assertEqual('removed', tvi.file_revisions['d'])