~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Martin Pool
  • Date: 2006-06-20 05:32:16 UTC
  • mfrom: (1797 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1798.
  • Revision ID: mbp@sourcefrog.net-20060620053216-817857d7ca3e9d1f
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
from bzrlib.errors import (BzrCheckError,
60
60
                           BzrError,
61
61
                           ConflictFormatError,
62
 
                           DivergedBranches,
63
62
                           WeaveRevisionNotPresent,
64
63
                           NotBranchError,
65
64
                           NoSuchFile,
458
457
    def get_file_byname(self, filename):
459
458
        return file(self.abspath(filename), 'rb')
460
459
 
 
460
    def get_parent_ids(self):
 
461
        """See Tree.get_parent_ids.
 
462
        
 
463
        This implementation reads the pending merges list and last_revision
 
464
        value and uses that to decide what the parents list should be.
 
465
        """
 
466
        last_rev = self.last_revision()
 
467
        if last_rev is None:
 
468
            parents = []
 
469
        else:
 
470
            parents = [last_rev]
 
471
        other_parents = self.pending_merges()
 
472
        return parents + other_parents
 
473
 
461
474
    def get_root_id(self):
462
475
        """Return the id of this trees root"""
463
476
        inv = self.read_working_inventory()
512
525
        # but with branch a kwarg now, passing in args as is results in the
513
526
        #message being used for the branch
514
527
        args = (DEPRECATED_PARAMETER, message, ) + args
515
 
        Commit().commit(working_tree=self, revprops=revprops, *args, **kwargs)
 
528
        committed_id = Commit().commit( working_tree=self, revprops=revprops,
 
529
            *args, **kwargs)
516
530
        self._set_inventory(self.read_working_inventory())
 
531
        return committed_id
517
532
 
518
533
    def id2abspath(self, file_id):
519
534
        return self.abspath(self.id2path(file_id))
1566
1581
        except NoSuchFile:
1567
1582
            raise errors.NoWorkingTree(base=transport.base)
1568
1583
        except KeyError:
1569
 
            raise errors.UnknownFormatError(format_string)
 
1584
            raise errors.UnknownFormatError(format=format_string)
1570
1585
 
1571
1586
    @classmethod
1572
1587
    def get_default_format(klass):