/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
0.436.2 by Jelmer Vernooij
Add stubs for testsuite, rebase-continue and rebase-abort commands.
1
# Copyright (C) 2006-2007 by Jelmer Vernooij
2
# 
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
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
0.436.16 by Jelmer Vernooij
Some more work on maptree.
16
"""Tests for the rebase code."""
0.436.2 by Jelmer Vernooij
Add stubs for testsuite, rebase-continue and rebase-abort commands.
17
0.436.7 by Jelmer Vernooij
Add more test, make basic rebase work.
18
from bzrlib.errors import UnknownFormatError, NoSuchFile
0.436.6 by Jelmer Vernooij
Add somewhat more complex plan generation function, rebase implementation.
19
from bzrlib.revision import NULL_REVISION
0.436.5 by Jelmer Vernooij
Import change_revision_parent from bzr-svn.
20
from bzrlib.tests import TestCase, TestCaseWithTransport
21
22
from rebase import (marshall_rebase_plan, unmarshall_rebase_plan, 
0.436.7 by Jelmer Vernooij
Add more test, make basic rebase work.
23
                    replay_snapshot, generate_simple_plan,
24
                    generate_transpose_plan, rebase_plan_exists,
0.436.18 by Jelmer Vernooij
More tests, extend MapTree a bit.
25
                    rebase_todo, REBASE_PLAN_FILENAME, 
26
                    REBASE_CURRENT_REVID_FILENAME, read_rebase_plan, 
27
                    remove_rebase_plan, read_active_rebase_revid, 
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
28
                    write_active_rebase_revid, write_rebase_plan, MapTree,
0.436.34 by Jelmer Vernooij
Some more tests.
29
                    ReplaySnapshotError, ReplayParentsInconsistent)
0.436.5 by Jelmer Vernooij
Import change_revision_parent from bzr-svn.
30
0.436.4 by Jelmer Vernooij
Add some tests.
31
0.436.3 by Jelmer Vernooij
Fill in commands.
32
class RebasePlanReadWriterTests(TestCase):
0.436.4 by Jelmer Vernooij
Add some tests.
33
    def test_simple_marshall_rebase_plan(self):
34
        self.assertEqualDiff(
35
"""# Bazaar rebase plan 1
36
1 bla
37
oldrev newrev newparent1 newparent2
38
""", marshall_rebase_plan((1, "bla"), 
39
                          {"oldrev": ("newrev", ["newparent1", "newparent2"])}))
40
41
    def test_simple_unmarshall_rebase_plan(self):
42
        self.assertEquals(((1, "bla"), 
43
                          {"oldrev": ("newrev", ["newparent1", "newparent2"])}),
44
                         unmarshall_rebase_plan("""# Bazaar rebase plan 1
45
1 bla
46
oldrev newrev newparent1 newparent2
47
"""))
48
49
    def test_unmarshall_rebase_plan_formatunknown(self):
50
        self.assertRaises(UnknownFormatError,
51
                         unmarshall_rebase_plan, """# Bazaar rebase plan x
52
1 bla
53
oldrev newrev newparent1 newparent2
54
""")
0.436.5 by Jelmer Vernooij
Import change_revision_parent from bzr-svn.
55
56
57
class ConversionTests(TestCaseWithTransport):
58
    def test_simple(self):
59
        wt = self.make_branch_and_tree('.')
60
        b = wt.branch
61
        file('hello', 'w').write('hello world')
62
        wt.add('hello')
63
        wt.commit(message='add hello', rev_id="bla")
64
        file('hello', 'w').write('world')
65
        wt.commit(message='change hello', rev_id="bloe")
66
        wt.set_last_revision("bla")
67
        b.set_revision_history(["bla"])
68
        file('hello', 'w').write('world')
69
        wt.commit(message='change hello', rev_id="bla2")
70
        
0.436.7 by Jelmer Vernooij
Add more test, make basic rebase work.
71
        newrev = replay_snapshot(wt.branch.repository, "bla2", "bla4", 
0.436.35 by Jelmer Vernooij
Make revid_renames argument mandatory.
72
                ["bloe"], {"bla": "bloe"})
0.436.5 by Jelmer Vernooij
Import change_revision_parent from bzr-svn.
73
        self.assertEqual("bla4", newrev)
74
        self.assertTrue(wt.branch.repository.has_revision(newrev))
0.436.20 by Jelmer Vernooij
Some more blackbox tests.
75
        self.assertEqual(["bloe"], 
76
                wt.branch.repository.revision_parents(newrev))
77
        self.assertEqual("bla2", 
78
            wt.branch.repository.get_revision(newrev).properties["rebase-of"])
0.436.6 by Jelmer Vernooij
Add somewhat more complex plan generation function, rebase implementation.
79
80
81
class PlanCreatorTests(TestCaseWithTransport):
82
    def test_simple_plan_creator(self):
83
        wt = self.make_branch_and_tree('.')
84
        b = wt.branch
85
        file('hello', 'w').write('hello world')
86
        wt.add('hello')
87
        wt.commit(message='add hello', rev_id="bla")
88
        file('hello', 'w').write('world')
89
        wt.commit(message='change hello', rev_id="bloe")
90
        wt.set_last_revision("bla")
91
        b.set_revision_history(["bla"])
92
        file('hello', 'w').write('world')
93
        wt.commit(message='change hello', rev_id="bla2")
94
95
        self.assertEquals({'bla2': ('newbla2', ["bloe"])}, 
96
                generate_simple_plan(b.repository, b.revision_history(), "bla2", "bloe", 
97
                    lambda y: "new"+y.revision_id))
98
     
99
    def test_simple_plan_creator_extra_history(self):
100
        wt = self.make_branch_and_tree('.')
101
        b = wt.branch
102
        file('hello', 'w').write('hello world')
103
        wt.add('hello')
104
        wt.commit(message='add hello', rev_id="bla")
105
        file('hello', 'w').write('world')
106
        wt.commit(message='change hello', rev_id="bloe")
107
        wt.set_last_revision("bla")
108
        b.set_revision_history(["bla"])
109
        file('hello', 'w').write('world')
110
        wt.commit(message='change hello', rev_id="bla2")
111
        file('hello', 'w').write('universe')
112
        wt.commit(message='change hello again', rev_id="bla3")
113
114
        self.assertEquals({'bla2': ('newbla2', ["bloe"]), 'bla3': ('newbla3', ['newbla2'])}, 
115
                generate_simple_plan(b.repository, b.revision_history(), "bla2", "bloe", 
116
                    lambda y: "new"+y.revision_id))
117
 
118
119
    def test_generate_transpose_plan(self):
120
        wt = self.make_branch_and_tree('.')
121
        b = wt.branch
122
        file('hello', 'w').write('hello world')
123
        wt.add('hello')
124
        wt.commit(message='add hello', rev_id="bla")
125
        file('hello', 'w').write('world')
126
        wt.commit(message='change hello', rev_id="bloe")
127
        wt.set_last_revision("bla")
128
        b.set_revision_history(["bla"])
129
        file('hello', 'w').write('world')
130
        wt.commit(message='change hello', rev_id="bla2")
131
        file('hello', 'w').write('universe')
132
        wt.commit(message='change hello again', rev_id="bla3")
133
        wt.set_last_revision("bla")
134
        b.set_revision_history(["bla"])
135
        file('hello', 'w').write('somebar')
136
        wt.commit(message='change hello yet again', rev_id="blie")
137
        wt.set_last_revision(NULL_REVISION)
138
        b.set_revision_history([])
139
        wt.add('hello')
140
        wt.commit(message='add hello', rev_id="lala")
141
142
        self.assertEquals({
0.436.36 by Jelmer Vernooij
Fix compatibility with bzr 0.19.
143
            'blie': ('newblie', ['lala'])},
144
            generate_transpose_plan(b.repository.get_revision_graph("blie"), 
145
            {"bla": "lala"}, b.repository.revision_parents, lambda y: "new"+y))
0.436.6 by Jelmer Vernooij
Add somewhat more complex plan generation function, rebase implementation.
146
        self.assertEquals({
0.436.36 by Jelmer Vernooij
Fix compatibility with bzr 0.19.
147
            'bla2': ('newbla2', ['lala']),
148
            'bla3': ('newbla3', ['newbla2']),
149
            'blie': ('newblie', ['lala']),
150
            'bloe': ('newbloe', ['lala'])},
151
            generate_transpose_plan(b.repository.get_revision_graph(), 
152
            {"bla": "lala"}, 
153
            b.repository.revision_parents, lambda y: "new"+y))
0.436.6 by Jelmer Vernooij
Add somewhat more complex plan generation function, rebase implementation.
154
0.436.31 by Jelmer Vernooij
Refactor generate_transpose_plan() to not take a repository object but
155
    def test_generate_transpose_plan_one(self):
156
        self.assertEquals({"bla": ("newbla", ["lala"])},
157
                generate_transpose_plan({"bla": ["bloe"], "bloe": []},
158
                    {"bloe": "lala"}, {}.get, lambda y: "new"+y))
0.436.7 by Jelmer Vernooij
Add more test, make basic rebase work.
159
160
class PlanFileTests(TestCaseWithTransport):
161
   def test_rebase_plan_exists_false(self):
162
        wt = self.make_branch_and_tree('.')
163
        self.assertFalse(rebase_plan_exists(wt))
164
165
   def test_rebase_plan_exists_empty(self):
166
        wt = self.make_branch_and_tree('.')
167
        wt._control_files.put_utf8(REBASE_PLAN_FILENAME, "")
168
        self.assertFalse(rebase_plan_exists(wt))
169
170
   def test_rebase_plan_exists(self):
171
        wt = self.make_branch_and_tree('.')
172
        wt._control_files.put_utf8(REBASE_PLAN_FILENAME, "foo")
173
        self.assertTrue(rebase_plan_exists(wt))
174
175
   def test_remove_rebase_plan(self):
176
        wt = self.make_branch_and_tree('.')
177
        wt._control_files.put_utf8(REBASE_PLAN_FILENAME, "foo")
178
        remove_rebase_plan(wt)
179
        self.assertFalse(rebase_plan_exists(wt))
180
181
   def test_remove_rebase_plan_twice(self):
182
        wt = self.make_branch_and_tree('.')
183
        remove_rebase_plan(wt)
184
        self.assertFalse(rebase_plan_exists(wt))
185
186
   def test_write_rebase_plan(self):
187
        wt = self.make_branch_and_tree('.')
188
        file('hello', 'w').write('hello world')
189
        wt.add('hello')
190
        wt.commit(message='add hello', rev_id="bla")
191
        write_rebase_plan(wt, 
192
                {"oldrev": ("newrev", ["newparent1", "newparent2"])})
193
        self.assertEqualDiff("""# Bazaar rebase plan 1
194
1 bla
195
oldrev newrev newparent1 newparent2
196
""", wt._control_files.get(REBASE_PLAN_FILENAME).read())
197
198
   def test_read_rebase_plan_nonexistant(self):
199
        wt = self.make_branch_and_tree('.')
200
        self.assertRaises(NoSuchFile, read_rebase_plan, wt)
201
202
   def test_read_rebase_plan_empty(self):
203
        wt = self.make_branch_and_tree('.')
204
        wt._control_files.put_utf8(REBASE_PLAN_FILENAME, "")
205
        self.assertRaises(NoSuchFile, read_rebase_plan, wt)
206
        
207
   def test_read_rebase_plan(self):
208
        wt = self.make_branch_and_tree('.')
209
        wt._control_files.put_utf8(REBASE_PLAN_FILENAME, """# Bazaar rebase plan 1
210
1 bla
211
oldrev newrev newparent1 newparent2
212
""")
0.436.36 by Jelmer Vernooij
Fix compatibility with bzr 0.19.
213
        self.assertEquals(((1, "bla"), 
214
            {"oldrev": ("newrev", ["newparent1", "newparent2"])}),
215
            read_rebase_plan(wt))
0.436.7 by Jelmer Vernooij
Add more test, make basic rebase work.
216
0.436.20 by Jelmer Vernooij
Some more blackbox tests.
217
0.436.9 by Jelmer Vernooij
Add rebase-todo command, fix rebase-continue.
218
class CurrentRevidFileTests(TestCaseWithTransport):
219
    def test_read_nonexistant(self):
220
        wt = self.make_branch_and_tree('.')
221
        self.assertIs(None, read_active_rebase_revid(wt))
222
223
    def test_read_null(self):
224
        wt = self.make_branch_and_tree('.')
225
        wt._control_files.put_utf8(REBASE_CURRENT_REVID_FILENAME, NULL_REVISION)
226
        self.assertIs(None, read_active_rebase_revid(wt))
227
228
    def test_read(self):
229
        wt = self.make_branch_and_tree('.')
230
        wt._control_files.put_utf8(REBASE_CURRENT_REVID_FILENAME, "bla")
231
        self.assertEquals("bla", read_active_rebase_revid(wt))
232
233
    def test_write(self):
234
        wt = self.make_branch_and_tree('.')
235
        write_active_rebase_revid(wt, "bloe")
236
        self.assertEquals("bloe", read_active_rebase_revid(wt))
237
238
    def test_write_null(self):
239
        wt = self.make_branch_and_tree('.')
240
        write_active_rebase_revid(wt, None)
241
        self.assertIs(None, read_active_rebase_revid(wt))
0.436.18 by Jelmer Vernooij
More tests, extend MapTree a bit.
242
0.436.20 by Jelmer Vernooij
Some more blackbox tests.
243
0.436.18 by Jelmer Vernooij
More tests, extend MapTree a bit.
244
class RebaseTodoTests(TestCase):
245
    def test_done(self):
246
        class Repository:
247
            def has_revision(self, revid):
248
                return revid == "bloe"
249
        self.assertEquals([], 
250
                list(rebase_todo(Repository(), { "bla": ("bloe", [])})))
251
252
    def test_notstarted(self):
253
        class Repository:
254
            def has_revision(self, revid):
255
                return False
256
        self.assertEquals(["bla"], 
257
                list(rebase_todo(Repository(), { "bla": ("bloe", [])})))
258
259
    def test_halfway(self):
260
        class Repository:
261
            def has_revision(self, revid):
262
                return revid == "bloe"
263
        self.assertEquals(["ha"], 
264
                list(rebase_todo(Repository(), { "bla": ("bloe", []), 
265
                                                 "ha": ("hee", [])})))
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
266
267
class ReplaySnapshotTests(TestCaseWithTransport):
268
    def test_single_revision(self):
269
        wt = self.make_branch_and_tree(".")
270
        self.build_tree(['afile'])
271
        wt.add(["afile"])
272
        wt.commit("bla", rev_id="oldcommit")
0.436.35 by Jelmer Vernooij
Make revid_renames argument mandatory.
273
        replay_snapshot(wt.branch.repository, "oldcommit", "newcommit", [],
274
                        {})
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
275
        oldrev = wt.branch.repository.get_revision("oldcommit")
276
        newrev = wt.branch.repository.get_revision("newcommit")
277
        self.assertEquals([], newrev.parent_ids)
278
        self.assertEquals("newcommit", newrev.revision_id)
279
        self.assertEquals(oldrev.committer, newrev.committer)
280
        self.assertEquals(oldrev.timestamp, newrev.timestamp)
281
        self.assertEquals(oldrev.timezone, newrev.timezone)
282
        inv = wt.branch.repository.get_inventory("newcommit")
283
        self.assertEquals("newcommit", inv[inv.path2id("afile")].revision)
284
285
    def test_parents_different(self):
286
        """replay_snapshot() relies on the fact that the contents of 
287
        the old and new parents is equal (at least concerning tree shape). If 
288
        it turns out it isn't, an exception should be raised."""
289
        wt = self.make_branch_and_tree(".")
290
        wt.commit("bloe", rev_id="base")
291
        self.build_tree(['afile', 'notherfile'])
292
        wt.add(["afile"])
293
        wt.commit("bla", rev_id="oldparent")
294
        wt.add(["notherfile"])
295
        wt.commit("bla", rev_id="oldcommit")
0.436.34 by Jelmer Vernooij
Some more tests.
296
        # this should raise an exception since oldcommit is being rewritten 
297
        # but 'afile' is present in the old parents but not in the new ones.
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
298
        self.assertRaises(
0.436.34 by Jelmer Vernooij
Some more tests.
299
                ReplayParentsInconsistent, replay_snapshot, 
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
300
                wt.branch.repository, "oldcommit", "newcommit", 
0.436.35 by Jelmer Vernooij
Make revid_renames argument mandatory.
301
                ["base"], {"oldparent": "base"})
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
302
0.436.34 by Jelmer Vernooij
Some more tests.
303
    def test_two_revisions(self):
304
        wt = self.make_branch_and_tree("old")
305
        self.build_tree(['old/afile', 'old/notherfile'])
306
        wt.add(["afile"], ["somefileid"])
307
        wt.commit("bla", rev_id="oldparent")
308
        wt.add(["notherfile"])
309
        wt.commit("bla", rev_id="oldcommit")
310
        oldrepos = wt.branch.repository
311
        wt = self.make_branch_and_tree("new")
312
        self.build_tree(['new/afile', 'new/notherfile'])
313
        wt.add(["afile"], ["afileid"])
314
        wt.commit("bla", rev_id="newparent")
315
        wt.branch.repository.fetch(oldrepos)
316
        replay_snapshot(wt.branch.repository, "oldcommit", "newcommit", 
0.436.35 by Jelmer Vernooij
Make revid_renames argument mandatory.
317
                ["newparent"], {"oldparent": "newparent"})
0.436.34 by Jelmer Vernooij
Some more tests.
318
        oldrev = wt.branch.repository.get_revision("oldcommit")
319
        newrev = wt.branch.repository.get_revision("newcommit")
320
        self.assertEquals(["newparent"], newrev.parent_ids)
321
        self.assertEquals("newcommit", newrev.revision_id)
322
        self.assertEquals(oldrev.committer, newrev.committer)
323
        self.assertEquals(oldrev.timestamp, newrev.timestamp)
324
        self.assertEquals(oldrev.timezone, newrev.timezone)
325
        inv = wt.branch.repository.get_inventory("newcommit")
326
        self.assertEquals("afileid", inv.path2id("afile"))
327
        self.assertEquals("newcommit", inv[inv.path2id("notherfile")].revision)
328
329
    def test_two_revisions_no_renames(self):
330
        wt = self.make_branch_and_tree("old")
331
        self.build_tree(['old/afile', 'old/notherfile'])
332
        wt.add(["afile"], ["somefileid"])
333
        wt.commit("bla", rev_id="oldparent")
334
        wt.add(["notherfile"])
335
        wt.commit("bla", rev_id="oldcommit")
336
        oldrepos = wt.branch.repository
337
        wt = self.make_branch_and_tree("new")
338
        self.build_tree(['new/afile', 'new/notherfile'])
339
        wt.add(["afile"], ["afileid"])
340
        wt.commit("bla", rev_id="newparent")
341
        wt.branch.repository.fetch(oldrepos)
342
        self.assertRaises(ReplayParentsInconsistent, 
343
                          replay_snapshot, wt.branch.repository, 
344
                          "oldcommit", "newcommit", 
345
                        ["newparent"], revid_renames={})
346
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
347
    def test_multi_revisions(self):
348
        wt = self.make_branch_and_tree("old")
0.436.35 by Jelmer Vernooij
Make revid_renames argument mandatory.
349
        self.build_tree(['old/afile', 'old/sfile', 'old/notherfile'])
350
        wt.add(['sfile'])
0.436.34 by Jelmer Vernooij
Some more tests.
351
        wt.add(["afile"], ["somefileid"])
352
        wt.commit("bla", rev_id="oldgrandparent")
353
        open("old/afile", "w").write("data")
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
354
        wt.commit("bla", rev_id="oldparent")
355
        wt.add(["notherfile"])
356
        wt.commit("bla", rev_id="oldcommit")
357
        oldrepos = wt.branch.repository
358
        wt = self.make_branch_and_tree("new")
0.436.35 by Jelmer Vernooij
Make revid_renames argument mandatory.
359
        self.build_tree(['new/afile', 'new/sfile', 'new/notherfile'])
360
        wt.add(['sfile'])
0.436.34 by Jelmer Vernooij
Some more tests.
361
        wt.add(["afile"], ["afileid"])
362
        wt.commit("bla", rev_id="newgrandparent")
363
        open("new/afile", "w").write("data")
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
364
        wt.commit("bla", rev_id="newparent")
365
        wt.branch.repository.fetch(oldrepos)
366
        replay_snapshot(wt.branch.repository, "oldcommit", "newcommit", 
0.436.35 by Jelmer Vernooij
Make revid_renames argument mandatory.
367
                ["newparent"], {"oldgrandparent": "newgrandparent", 
368
                                "oldparent": "newparent"})
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
369
        oldrev = wt.branch.repository.get_revision("oldcommit")
370
        newrev = wt.branch.repository.get_revision("newcommit")
0.436.34 by Jelmer Vernooij
Some more tests.
371
        self.assertEquals(["newparent"], newrev.parent_ids)
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
372
        self.assertEquals("newcommit", newrev.revision_id)
373
        self.assertEquals(oldrev.committer, newrev.committer)
374
        self.assertEquals(oldrev.timestamp, newrev.timestamp)
375
        self.assertEquals(oldrev.timezone, newrev.timezone)
376
        inv = wt.branch.repository.get_inventory("newcommit")
0.436.34 by Jelmer Vernooij
Some more tests.
377
        self.assertEquals("afileid", inv.path2id("afile"))
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
378
        self.assertEquals("newcommit", inv[inv.path2id("notherfile")].revision)
0.436.35 by Jelmer Vernooij
Make revid_renames argument mandatory.
379
        self.assertEquals("newgrandparent", inv[inv.path2id("sfile")].revision)
0.436.34 by Jelmer Vernooij
Some more tests.
380
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
381
    def test_maps_ids(self):
382
        wt = self.make_branch_and_tree("old")
383
        wt.commit("base", rev_id="base")
384
        self.build_tree(['old/afile'])
385
        wt.add(["afile"], ids=["originalid"])
386
        wt.commit("bla", rev_id="oldparent")
387
        file("old/afile", "w").write("bloe")
388
        wt.commit("bla", rev_id="oldcommit")
389
        oldrepos = wt.branch.repository
390
        wt = self.make_branch_and_tree("new")
391
        self.build_tree(['new/afile'])
392
        wt.add(["afile"], ids=["newid"])
393
        wt.commit("bla", rev_id="newparent")
394
        wt.branch.repository.fetch(oldrepos)
395
        replay_snapshot(wt.branch.repository, "oldcommit", "newcommit", 
0.436.35 by Jelmer Vernooij
Make revid_renames argument mandatory.
396
                ["newparent"], {"oldparent": "newparent"})
0.436.32 by Jelmer Vernooij
Properly detect invalid snapshot replays.
397
        oldrev = wt.branch.repository.get_revision("oldcommit")
398
        newrev = wt.branch.repository.get_revision("newcommit")
399
        self.assertEquals(["newparent"], newrev.parent_ids)
400
        self.assertEquals("newcommit", newrev.revision_id)
401
        self.assertEquals(oldrev.committer, newrev.committer)
402
        self.assertEquals(oldrev.timestamp, newrev.timestamp)
403
        self.assertEquals(oldrev.timezone, newrev.timezone)
404
        inv = wt.branch.repository.get_inventory("newcommit")
405
        self.assertEquals("newid", inv.path2id("afile"))
406
        self.assertEquals("newcommit", inv[inv.path2id("afile")].revision)
407
0.436.34 by Jelmer Vernooij
Some more tests.
408
class TestReplaySnapshotError(TestCase):
409
    def test_create(self):
410
        ReplaySnapshotError("message")
411
412
413
class TestReplayParentsInconsistent(TestCase):
414
    def test_create(self):
415
        ReplayParentsInconsistent("afileid", "arevid")