~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Got unique_add under test

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import os
 
2
from bzrlib.errors import DuplicateKey
2
3
def unique_add(map, key, value):
3
4
    if key in map:
4
 
        raise Exception("Key %s already present in map")
 
5
        raise DuplicateKey(key=key)
5
6
    map[key] = value
6
7
 
7
8
class TreeTransform(object):