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

  • Committer: Aaron Bentley
  • Date: 2006-06-15 20:20:48 UTC
  • mfrom: (1776 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1788.
  • Revision ID: abentley@panoramicfeedback.com-20060615202048-fcee4d87e363a002
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
 
150
150
 
151
151
class TreeEntry(object):
152
 
    """An entry that implements the minium interface used by commands.
 
152
    """An entry that implements the minimum interface used by commands.
153
153
 
154
154
    This needs further inspection, it may be better to have 
155
155
    InventoryEntries without ids - though that seems wrong. For now,
509
509
        # but with branch a kwarg now, passing in args as is results in the
510
510
        #message being used for the branch
511
511
        args = (DEPRECATED_PARAMETER, message, ) + args
512
 
        Commit().commit(working_tree=self, revprops=revprops, *args, **kwargs)
 
512
        committed_id = Commit().commit( working_tree=self, revprops=revprops,
 
513
            *args, **kwargs)
513
514
        self._set_inventory(self.read_working_inventory())
 
515
        return committed_id
514
516
 
515
517
    def id2abspath(self, file_id):
516
518
        return self.abspath(self.id2path(file_id))
552
554
            if not path:
553
555
                path = self._inventory.id2path(file_id)
554
556
            mode = os.lstat(self.abspath(path)).st_mode
555
 
            return bool(stat.S_ISREG(mode) and stat.S_IEXEC&mode)
 
557
            return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
556
558
 
557
559
    @needs_write_lock
558
560
    def add(self, files, ids=None):
1349
1351
        # of a nasty hack; probably it's better to have a transaction object,
1350
1352
        # which can do some finalization when it's either successfully or
1351
1353
        # unsuccessfully completed.  (Denys's original patch did that.)
1352
 
        # RBC 20060206 hookinhg into transaction will couple lock and transaction
1353
 
        # wrongly. Hookinh into unllock on the control files object is fine though.
 
1354
        # RBC 20060206 hooking into transaction will couple lock and transaction
 
1355
        # wrongly. Hooking into unlock on the control files object is fine though.
1354
1356
        
1355
1357
        # TODO: split this per format so there is no ugly if block
1356
1358
        if self._hashcache.needs_write and (
1402
1404
                                      this_tree=self)
1403
1405
                self.set_last_revision(self.branch.last_revision())
1404
1406
            if old_tip and old_tip != self.last_revision():
1405
 
                # our last revision was not the prior branch last reivison
 
1407
                # our last revision was not the prior branch last revision
1406
1408
                # and we have converted that last revision to a pending merge.
1407
1409
                # base is somewhere between the branch tip now
1408
1410
                # and the now pending merge
1444
1446
            try:
1445
1447
                if file_kind(self.abspath(conflicted)) != "file":
1446
1448
                    text = False
1447
 
            except OSError, e:
1448
 
                if e.errno == errno.ENOENT:
1449
 
                    text = False
1450
 
                else:
1451
 
                    raise
 
1449
            except errors.NoSuchFile:
 
1450
                text = False
1452
1451
            if text is True:
1453
1452
                for suffix in ('.THIS', '.OTHER'):
1454
1453
                    try:
1455
1454
                        kind = file_kind(self.abspath(conflicted+suffix))
1456
 
                    except OSError, e:
1457
 
                        if e.errno == errno.ENOENT:
 
1455
                        if kind != "file":
1458
1456
                            text = False
1459
 
                            break
1460
 
                        else:
1461
 
                            raise
1462
 
                    if kind != "file":
 
1457
                    except errors.NoSuchFile:
1463
1458
                        text = False
 
1459
                    if text == False:
1464
1460
                        break
1465
1461
            ctype = {True: 'text conflict', False: 'contents conflict'}[text]
1466
1462
            conflicts.append(Conflict.factory(ctype, path=conflicted,
1724
1720
    def initialize(self, a_bzrdir, revision_id=None):
1725
1721
        """See WorkingTreeFormat.initialize().
1726
1722
        
1727
 
        revision_id allows creating a working tree at a differnet
 
1723
        revision_id allows creating a working tree at a different
1728
1724
        revision than the branch is at.
1729
1725
        """
1730
1726
        if not isinstance(a_bzrdir.transport, LocalTransport):