/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-26 22:08:14 UTC
  • mto: (2255.11.3 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: john@arbash-meinel.com-20070226220814-i6a95mlsdsv3yrf8
Make sure adding a duplicate file_id raises DuplicateFileId.
This adds an explicit test for it, updates Inventory to raise the right error,
and updates Dirstate.add() to also check for a duplicated file_id.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1377
1377
        self.file_id = file_id
1378
1378
 
1379
1379
 
 
1380
class DuplicateFileId(BzrError):
 
1381
 
 
1382
    _fmt = "File id {%(file_id)s} already exists in inventory as %(entry)s"
 
1383
 
 
1384
    def __init__(self, file_id, entry):
 
1385
        BzrError.__init__(self)
 
1386
        self.file_id = file_id
 
1387
        self.entry = entry
 
1388
 
 
1389
 
1380
1390
class DuplicateKey(BzrError):
1381
1391
 
1382
1392
    _fmt = "Key %(key)s is already present in map"