Changeset 1521 in tailor


Ignore:
Timestamp:
05/21/08 03:16:21 (5 years ago)
Author:
lele@…
Hash name:
20080521011621-97f81-e59b203d556b383dc956b1a44bf109f05e94a605
Message:

Tell the target about the changeset even before the source
The target has a chance of preexecuting some entries, or stopping the
process for whatever reason.

Location:
vcpx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vcpx/target.py

    r1471 r1521  
    9797            changelog = changeset.log 
    9898        return patchname, changelog 
     99 
     100    def _prepareToReplayChangeset(self, changeset): 
     101        """ 
     102        This is called **before** fetching and applying the source 
     103        changeset. This implementation does nothing more than 
     104        returning True. Subclasses may override it, for example to 
     105        preexecute some entries such as moves. 
     106 
     107        Returning False the changeset won't be applied and the 
     108        process will stop. 
     109        """ 
     110 
     111        return True 
    99112 
    100113    def replayChangeset(self, changeset): 
  • vcpx/dualwd.py

    r1413 r1521  
    9393 
    9494    def applyPendingChangesets(self, applyable=None, replay=None, applied=None): 
     95        def pre_replay(changeset): 
     96            if applyable and not applyable(changeset): 
     97                return 
     98            return self.target._prepareToReplayChangeset(changeset) 
     99 
    95100        return self.source.applyPendingChangesets(replay=self.replayChangeset, 
    96                                                   applyable=applyable, 
     101                                                  applyable=pre_replay, 
    97102                                                  applied=applied) 
    98103 
Note: See TracChangeset for help on using the changeset viewer.