311
311
class WorkingTreeFileUpdateTests(TestCaseWithTransport):
312
"""Tests for _determine_fileid_renames()."""
314
def test_det_renames_same(self):
316
a.add_path("bla", "directory", "bla-a")
318
b.add_path("bla", "directory", "bla-a")
320
'': ('TREE_ROOT', 'TREE_ROOT'),
321
'bla': ('bla-a', 'bla-a')},
322
foreign._determine_fileid_renames(a, b))
324
def test_det_renames_simple(self):
326
a.add_path("bla", "directory", "bla-a")
328
b.add_path("bla", "directory", "bla-b")
330
'': ('TREE_ROOT', 'TREE_ROOT'),
331
'bla': ('bla-a', 'bla-b'),
332
}, foreign._determine_fileid_renames(a, b))
334
def test_det_renames_root(self):
336
a.add_path("", "directory", "bla-a")
338
b.add_path("", "directory", "bla-b")
340
{"": ("bla-a", "bla-b")},
341
foreign._determine_fileid_renames(a, b))
343
def test_update_workinginv(self):
345
a.add_path("bla", "directory", "bla-a")
347
b.add_path("bla", "directory", "bla-b")
348
wt = self.make_branch_and_tree('br1')
349
self.build_tree_contents([('br1/bla', 'original contents\n')])
350
wt.add('bla', 'bla-a')
351
foreign.update_workinginv_fileids(wt, a, b)
354
self.assertEquals(["TREE_ROOT", "bla-b"], list(wt.inventory))
312
"""Tests for update_workingtree_fileids()."""
358
314
def test_update_workingtree(self):
359
315
wt = self.make_branch_and_tree('br1')