~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_add.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-01 14:59:16 UTC
  • mfrom: (5870.1.44 smart-add-invdelta)
  • Revision ID: pqm@pqm.ubuntu.com-20110601145916-5uuwhu9e764po62d
(jelmer) (jelmer) Bug #146165,
 use apply_inventory_delta instead of _write_inventory for 'bzr add'" (Jelmer
 Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
        # The first part just logs if appropriate
31
31
        # Now generate a custom id
32
32
        file_id = osutils.safe_file_id(kind + '-'
33
 
                                       + path.raw_path.replace('/', '%'),
 
33
                                       + path.replace('/', '%'),
34
34
                                       warn=False)
35
35
        if self.should_print:
36
36
            self._to_file.write('added %s with id %s\n'
37
 
                                % (path.raw_path, file_id))
 
37
                                % (path, file_id))
38
38
        return file_id
39
39
 
40
40
 
152
152
        self.run_action("adding path\n")
153
153
 
154
154
    def run_action(self, output):
155
 
        from bzrlib.mutabletree import _FastPath
156
155
        inv = inventory.Inventory()
157
156
        stdout = StringIO()
158
157
        action = add.AddAction(to_file=stdout, should_print=bool(output))
159
158
 
160
159
        self.apply_redirected(None, stdout, None, action, inv, None,
161
 
            _FastPath('path'), 'file')
 
160
            'path', 'file')
162
161
        self.assertEqual(stdout.getvalue(), output)