/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 breezy/memorytree.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-04 05:10:44 UTC
  • mfrom: (7293 work)
  • mto: This revision was merged to the branch mainline in revision 7294.
  • Revision ID: jelmer@jelmer.uk-20190304051044-vph4s8p9qvpy2qe9
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
        missing files, so is a no-op.
86
86
        """
87
87
 
88
 
    def get_file(self, path, file_id=None):
 
88
    def get_file(self, path):
89
89
        """See Tree.get_file."""
90
90
        return self._file_transport.get(path)
91
91
 
92
 
    def get_file_sha1(self, path, file_id=None, stat_value=None):
 
92
    def get_file_sha1(self, path, stat_value=None):
93
93
        """See Tree.get_file_sha1()."""
94
94
        stream = self._file_transport.get(path)
95
95
        return sha_file(stream)
147
147
    def is_executable(self, path):
148
148
        return self._inventory.get_entry_by_path(path).executable
149
149
 
150
 
    def kind(self, path, file_id=None):
151
 
        if file_id is None:
152
 
            file_id = self.path2id(path)
 
150
    def kind(self, path):
 
151
        file_id = self.path2id(path)
153
152
        return self._inventory[file_id].kind
154
153
 
155
154
    def mkdir(self, path, file_id=None):
234
233
            else:
235
234
                raise NotImplementedError(self._populate_from_branch)
236
235
 
237
 
    def put_file_bytes_non_atomic(self, path, bytes, file_id=None):
 
236
    def put_file_bytes_non_atomic(self, path, bytes):
238
237
        """See MutableTree.put_file_bytes_non_atomic."""
239
238
        self._file_transport.put_bytes(path, bytes)
240
239
 
256
255
        else:
257
256
            self._locks -= 1
258
257
 
259
 
    def unversion(self, paths, file_ids=None):
 
258
    def unversion(self, paths):
260
259
        """Remove the paths from the current versioned set.
261
260
 
262
261
        When a file_id is unversioned, all of its children are automatically
269
268
            # XXX: This should be in mutabletree, but the inventory-save action
270
269
            # is not relevant to memory tree. Until that is done in unlock by
271
270
            # working tree, we cannot share the implementation.
272
 
            if file_ids is None:
273
 
                file_ids = set()
274
 
                for path in paths:
275
 
                    file_id = self.path2id(path)
276
 
                    if file_id is None:
277
 
                        raise errors.NoSuchFile(path)
278
 
                    file_ids.add(file_id)
279
 
            else:
280
 
                for file_id in file_ids:
281
 
                    if not self._inventory.has_id(file_id):
282
 
                        raise errors.NoSuchId(self, file_id)
 
271
            file_ids = set()
 
272
            for path in paths:
 
273
                file_id = self.path2id(path)
 
274
                if file_id is None:
 
275
                    raise errors.NoSuchFile(path)
 
276
                file_ids.add(file_id)
283
277
            for file_id in file_ids:
284
278
                if self._inventory.has_id(file_id):
285
279
                    self._inventory.remove_recursive_id(file_id)