Changeset 1022 in tailor


Ignore:
Timestamp:
11/28/05 22:07:37 (7 years ago)
Author:
Bart Teeuwisse <bart.teeuwisse@…>
Hash name:
20051128210737-f2f79-2baf4663424c04e742bf7e2ab94ecf29eaaed69f
Message:

bzr WorkingTree? fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/bzr.py

    r993 r1022  
    1616from target import SyncronizableTargetWorkingDir, TargetInitializationFailure 
    1717from bzrlib.branch import Branch 
     18from bzrlib.delta import compare_trees 
    1819 
    1920class BzrWorkingDir(UpdatableSourceWorkingDir, SyncronizableTargetWorkingDir): 
     
    120121        # entries; and Branch.add complains if a file is already 
    121122        # versioned.  So go through the list and sort out entries that 
    122         # is already versioned, since there is no need to add them. 
    123         # Do not try to catch any errors from Branch.add, since the 
    124         # they are _real_ errors. 
     123        # is already versioned, since there is no need to add them.  A 
     124        # file can also already have been marked to be added in this 
     125        # changeset. Remove those files too. Do not try to catch any 
     126        # errors from Branch.add, since the they are _real_ errors. 
    125127        new_entries = [] 
    126128        inv = self._b.get_inventory(self._b.last_revision()) 
     129        added = [new[0] for new in compare_trees(self._b.revision_tree(self._b.last_revision()), self._b.working_tree()).added] 
    127130        for e in entries: 
    128             if not inv.has_filename(e): 
     131            if not inv.has_filename(e) and not e in added: 
    129132                new_entries.extend([e]) 
    130133            else: 
     
    133136        if len(new_entries) == 0: 
    134137            return 
    135         self.log.info('Adding %s...', ', '.join(entries)) 
     138        self.log.info('Adding %s...', ', '.join(new_entries)) 
    136139        self._b.add(new_entries) 
    137140 
     
    178181        revision_id = "%s-%s-%s" % (email, compact_date(timestamp), 
    179182                                    hexlify(rand_bytes(8))) 
    180         self._b.commit(logmessage, committer=author, 
     183        self._b.working_tree().commit(logmessage, committer=author, 
    181184                       specific_files=entries, rev_id=revision_id, 
    182185                       verbose=self.repository.projectref().verbose, 
Note: See TracChangeset for help on using the changeset viewer.