/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/mutabletree.py

  • Committer: Martin Pool
  • Date: 2008-06-11 02:36:40 UTC
  • mfrom: (3490 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3492.
  • Revision ID: mbp@sourcefrog.net-20080611023640-db0lqd75yueksdw7
Merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        TODO: Perhaps callback with the ids and paths as they're added.
97
97
        """
98
98
        if isinstance(files, basestring):
99
 
            assert(ids is None or isinstance(ids, basestring))
100
 
            assert(kinds is None or isinstance(kinds, basestring))
 
99
            # XXX: Passing a single string is inconsistent and should be
 
100
            # deprecated.
 
101
            if not (ids is None or isinstance(ids, basestring)):
 
102
                raise AssertionError()
 
103
            if not (kinds is None or isinstance(kinds, basestring)):
 
104
                raise AssertionError()
101
105
            files = [files]
102
106
            if ids is not None:
103
107
                ids = [ids]
109
113
        if ids is None:
110
114
            ids = [None] * len(files)
111
115
        else:
112
 
            assert(len(ids) == len(files))
 
116
            if not (len(ids) == len(files)):
 
117
                raise AssertionError()
113
118
        if kinds is None:
114
119
            kinds = [None] * len(files)
115
 
        else:
116
 
            assert(len(kinds) == len(files))
 
120
        elif not len(kinds) == len(files):
 
121
            raise AssertionError()
117
122
        for f in files:
118
123
            # generic constraint checks:
119
124
            if self.is_control_filename(f):
180
185
            revprops['branch-nick'] = self.branch.nick
181
186
        author = kwargs.pop('author', None)
182
187
        if author is not None:
183
 
            assert 'author' not in revprops
 
188
            if 'author' in revprops:
 
189
                # XXX: maybe we should just accept one of them?
 
190
                raise AssertionError('author property given twice')
184
191
            revprops['author'] = author
185
192
        # args for wt.commit start at message from the Commit.commit method,
186
193
        args = (message, ) + args
289
296
        # not in an inner loop; and we want to remove direct use of this,
290
297
        # so here as a reminder for now. RBC 20070703
291
298
        from bzrlib.inventory import InventoryEntry
292
 
        assert isinstance(recurse, bool)
293
299
        if action is None:
294
300
            action = add.AddAction()
295
301