~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Aaron Bentley
  • Date: 2012-07-18 19:55:04 UTC
  • mto: This revision was merged to the branch mainline in revision 6540.
  • Revision ID: aaron@aaronbentley.com-20120718195504-hrl4w190lynohkhd
Cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
        raise NotImplementedError(self._put_uncommitted)
269
269
 
270
270
    def _uncommitted_branch(self):
 
271
        """Return the branch that may contain uncommitted changes."""
271
272
        master = self.get_master_branch()
272
273
        if master is not None:
273
274
            return master
279
280
        return self._uncommitted_branch()._get_uncommitted() is not None
280
281
 
281
282
    def store_uncommitted(self, creator, message=None):
 
283
        """Store uncommitted changes from a ShelfCreator.
 
284
 
 
285
        :param creator: The ShelfCreator containing uncommitted changes.
 
286
        :param message: The message to associate with the changes.
 
287
        :raises: ChangesAlreadyStored if the branch already has changes.
 
288
        """
282
289
        branch = self._uncommitted_branch()
283
290
        if branch.has_stored_uncommitted():
284
291
            raise errors.ChangesAlreadyStored
288
295
        branch._put_uncommitted(transform)
289
296
 
290
297
    def get_unshelver(self, tree):
 
298
        """Return a shelf.Unshelver for this branch and tree.
 
299
 
 
300
        :param tree: The tree to use to construct the Unshelver.
 
301
        :return: an Unshelver or None if no changes are stored.
 
302
        """
291
303
        transform = self._uncommitted_branch()._get_uncommitted()
292
304
        if transform is None:
293
305
            return
2428
2440
            self.conf_store =  _mod_config.BranchStore(self)
2429
2441
        return self.conf_store
2430
2442
 
 
2443
    @needs_read_lock
2431
2444
    def _get_uncommitted(self):
2432
2445
        """Return a serialized TreeTransform for uncommitted changes.
2433
2446
 
2439
2452
        except errors.NoSuchFile:
2440
2453
            return None
2441
2454
 
 
2455
    @needs_write_lock
2442
2456
    def _put_uncommitted(self, transform):
2443
2457
        """Store a serialized TreeTransform for uncommitted changes.
2444
2458