/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/per_repository_vf/test_fileid_involved.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import sys
18
18
import time
19
19
 
20
 
from bzrlib import (
 
20
from breezy import (
21
21
    errors,
22
22
    inventory,
23
23
    remote,
25
25
    tests,
26
26
    transform,
27
27
    )
28
 
from bzrlib.tests.scenarios import load_tests_apply_scenarios
29
 
from bzrlib.tests.per_repository_vf import (
 
28
from breezy.tests.scenarios import load_tests_apply_scenarios
 
29
from breezy.tests.per_repository_vf import (
30
30
    TestCaseWithRepository,
31
31
    all_repository_vf_format_scenarios,
32
32
    )
82
82
        b = self.create_branch_with_ghost_text()
83
83
        repo = b.repository
84
84
        self.assertEqual(
85
 
            {'a-file-id':set(['ghost-id'])},
 
85
            {'a-file-id':{'ghost-id'}},
86
86
            repo.fileids_altered_by_revision_ids(['B-id']))
87
87
 
88
88
    def test_file_ids_uses_fallbacks(self):
112
112
        stacked.lock_read()
113
113
        self.addCleanup(stacked.unlock)
114
114
        repo = stacked.repository
115
 
        keys = {'file-id': set(['A-id'])}
 
115
        keys = {'file-id': {'A-id'}}
116
116
        if stacked.repository.supports_rich_root():
117
 
            keys['root-id'] = set(['A-id'])
 
117
            keys['root-id'] = {'A-id'}
118
118
        self.assertEqual(keys, repo.fileids_altered_by_revision_ids(['A-id']))
119
119
 
120
120
 
237
237
        self.addCleanup(self.branch.unlock)
238
238
        self.branch.repository.fileids_altered_by_revision_ids(["rev-J","rev-K"])
239
239
        self.assertEqual(
240
 
            {'b-file-id-2006-01-01-defg':set(['rev-J']),
241
 
             'c-funky<file-id>quiji%bo':set(['rev-K'])
 
240
            {'b-file-id-2006-01-01-defg':{'rev-J'},
 
241
             'c-funky<file-id>quiji%bo':{'rev-K'}
242
242
             },
243
243
            self.branch.repository.fileids_altered_by_revision_ids(["rev-J","rev-K"]))
244
244
 
245
245
        self.assertEqual(
246
 
            {'b-file-id-2006-01-01-defg': set(['rev-<D>']),
247
 
             'file-d': set(['rev-F']),
 
246
            {'b-file-id-2006-01-01-defg': {'rev-<D>'},
 
247
             'file-d': {'rev-F'},
248
248
             },
249
249
            self.branch.repository.fileids_altered_by_revision_ids(['rev-<D>', 'rev-F']))
250
250
 
251
251
        self.assertEqual(
252
252
            {
253
 
             'b-file-id-2006-01-01-defg': set(['rev-<D>', 'rev-G', 'rev-J']),
254
 
             'c-funky<file-id>quiji%bo': set(['rev-K']),
255
 
             'file-d': set(['rev-F']),
 
253
             'b-file-id-2006-01-01-defg': {'rev-<D>', 'rev-G', 'rev-J'},
 
254
             'c-funky<file-id>quiji%bo': {'rev-K'},
 
255
             'file-d': {'rev-F'},
256
256
             },
257
257
            self.branch.repository.fileids_altered_by_revision_ids(
258
258
                ['rev-<D>', 'rev-G', 'rev-F', 'rev-K', 'rev-J']))
259
259
 
260
260
        self.assertEqual(
261
 
            {'a-file-id-2006-01-01-abcd': set(['rev-B']),
262
 
             'b-file-id-2006-01-01-defg': set(['rev-<D>', 'rev-G', 'rev-J']),
263
 
             'c-funky<file-id>quiji%bo': set(['rev-K']),
264
 
             'file-d': set(['rev-F']),
 
261
            {'a-file-id-2006-01-01-abcd': {'rev-B'},
 
262
             'b-file-id-2006-01-01-defg': {'rev-<D>', 'rev-G', 'rev-J'},
 
263
             'c-funky<file-id>quiji%bo': {'rev-K'},
 
264
             'file-d': {'rev-F'},
265
265
             },
266
266
            self.branch.repository.fileids_altered_by_revision_ids(
267
267
                ['rev-G', 'rev-F', 'rev-C', 'rev-B', 'rev-<D>', 'rev-K', 'rev-J']))
279
279
        self.branch.lock_read()
280
280
        self.addCleanup(self.branch.unlock)
281
281
        self.assertEqual(
282
 
            {'a-file-id-2006-01-01-abcd':set(['rev-A']),
283
 
             'b-file-id-2006-01-01-defg': set(['rev-A']),
284
 
             'c-funky<file-id>quiji%bo': set(['rev-A']),
 
282
            {'a-file-id-2006-01-01-abcd':{'rev-A'},
 
283
             'b-file-id-2006-01-01-defg': {'rev-A'},
 
284
             'c-funky<file-id>quiji%bo': {'rev-A'},
285
285
             },
286
286
            self.fileids_altered_by_revision_ids(["rev-A"]))
287
287
        self.assertEqual(
288
 
            {'a-file-id-2006-01-01-abcd':set(['rev-B'])
 
288
            {'a-file-id-2006-01-01-abcd':{'rev-B'}
289
289
             },
290
290
            self.branch.repository.fileids_altered_by_revision_ids(["rev-B"]))
291
291
        self.assertEqual(
292
 
            {'b-file-id-2006-01-01-defg':set(['rev-<D>'])
 
292
            {'b-file-id-2006-01-01-defg':{'rev-<D>'}
293
293
             },
294
294
            self.branch.repository.fileids_altered_by_revision_ids(["rev-<D>"]))
295
295
 
346
346
        file_ids = repo.fileids_altered_by_revision_ids([revision_id])
347
347
        root_id = main_wt.basis_tree().get_root_id()
348
348
        if root_id in file_ids:
349
 
            self.assertEqual({file_id:set([revision_id]),
350
 
                              root_id:set([revision_id])
 
349
            self.assertEqual({file_id:{revision_id},
 
350
                              root_id:{revision_id}
351
351
                             }, file_ids)
352
352
        else:
353
 
            self.assertEqual({file_id:set([revision_id])}, file_ids)
 
353
            self.assertEqual({file_id:{revision_id}}, file_ids)
354
354
 
355
355
 
356
356
class TestFileIdInvolvedSuperset(FileIdInvolvedBase):