source: tailor/vcpx/dualwd.py @ 607

Revision 607, 2.3 KB checked in by lele@…, 8 years ago (diff)

Renamed initializeNewWorkingDir() to importFirstRevision()

RevLine 
[15]1# -*- mode: python; coding: utf-8 -*-
2# :Progetto: vcpx -- Dual working directory
3# :Creato:   dom 20 giu 2004 11:02:01 CEST
4# :Autore:   Lele Gaifax <lele@nautilus.homeip.net>
[305]5# :Licenza:  GNU General Public License
[451]6#
[15]7
8"""
9The easiest way to propagate changes from one VC control system to one
10of an another kind is having a single directory containing a live
11working copy shared between the two VC systems.
12
13This module implements `DualWorkingDir`, which instances have a
14`source` and `target` properties offering the right capabilities to do
15the job.
16"""
17
18__docformat__ = 'reStructuredText'
19
[184]20from source import UpdatableSourceWorkingDir, InvocationError
[16]21from target import SyncronizableTargetWorkingDir
22
[476]23IGNORED_METADIRS = []
[383]24
[15]25class DualWorkingDir(UpdatableSourceWorkingDir, SyncronizableTargetWorkingDir):
26    """
27    Dual working directory, one that is under two different VC systems at
28    the same time.
29
30    This class reimplements the two interfaces, dispatching the right method
[464]31    to the right backend.
[15]32    """
33
[468]34    def __init__(self, source_repo, target_repo):
35        global IGNORED_METADIRS
[15]36
[468]37        self.source = source_repo.workingDir()
38        self.target = target_repo.workingDir()
[451]39
[468]40        IGNORED_METADIRS = [source_repo.METADIR, target_repo.METADIR]
[451]41
[363]42        # UpdatableSourceWorkingDir
[451]43
[466]44        self.getPendingChangesets = self.source.getPendingChangesets
[363]45        self.checkoutUpstreamRevision = self.source.checkoutUpstreamRevision
[451]46
[363]47        # SyncronizableTargetWorkingDir
[451]48
[452]49        self.prepareWorkingDirectory = self.target.prepareWorkingDirectory
[607]50        self.importFirstRevision = self.target.importFirstRevision
[363]51        self.replayChangeset = self.target.replayChangeset
[451]52
[541]53    def setStateFile(self, state_file):
54        """
55        Set the state file used to store the revision and pending changesets.
56        """
57
58        self.source.setStateFile(state_file)
59        self.target.setStateFile(state_file)
60
61    def setLogfile(self, logfile):
62        """
63        Set the name of the logfile, just to ignore it.
64        """
65
66        self.target.logfile = logfile
67
[527]68    def applyPendingChangesets(self, applyable=None, replay=None, applied=None):
69        return self.source.applyPendingChangesets(replay=self.replayChangeset,
[466]70                                                  applyable=applyable,
[527]71                                                  applied=applied)
Note: See TracBrowser for help on using the repository browser.