;ς ˆΈ“Fc@scdZdZdklZdklZdklZdefd„ƒYZde fd„ƒYZ d S( s΅ This module implements a higher level of operations, with a Project class that knows how to drive the two main activities, bootstrap and update, layering on top of DualWorkingDir. sreStructuredText(sTailorException(sConfigurationError(s StateFilesUnknownProjectErrorcBstZdZRS(sProject does not exist(s__name__s __module__s__doc__(((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pysUnknownProjectErrors sProjectcBsMtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(sα This class collects the information related to a single project, such as its source and target repositories and state file. All the setup comes from a section in the configuration file (.ini-like format) with the same name as the project. Mandatory options are: root-directory This is where all the fun will happen: this directory will contain the source and the target working copy, and usually the state and the log file. It support the conventional "~user" to indicate user's home directory. subdir This is the subdirectory, relative to the root-directory, where tailor will extract the source working copy. It may be '.' for some backend kinds. state-file Name of the state file needed to store tailor last activity. source The source repository: a repository name is something like "darcs:somename", that will be loaded from the homonymous section in the configuration. target The counterpart of `source`, the repository that will receive the changes coming from there. Non mandatory options: before-commit This is a function name, or a sequence of function names enclosed by brackets, that will be executed on each changeset just before it get replayed on the target system: this may be used to perform any kind of alteration on the content of the changeset, or to skip some of them. after-commit This is a function name, or a sequence of function names enclosed by brackets, that will be executed on each changeset just after the commit on the target system: this may be used for example to create a tag. start-revision This identifies from when tailor should start the migration. It can be either ``INITIAL``, to indicate the start of the history, or ``HEAD`` to indicate the current latest changeset, or a backend specific way of indicate a particular revision/tag in the history. cCsŸdkl}t|_|i|ƒ otd|ƒ‚n||_||_t|_ y|i ƒWn4|j o(}t d|it |ƒfƒ‚nXdS(sL Initialize a new instance representing the project `name`. (sErrors'%s' is not a known projects'Invalid configuration in section %s: %sN(s ConfigParsersErrorsNonesselfs loghandlersconfigs has_sectionsnamesUnknownProjectErrorsdwds_loadsesConfigurationErrorsstr(sselfsnamesconfigsesError((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pys__init__Os     c Csbd|i|ifdigi}dddfD]#}|d|t||ƒfƒq0~ƒSdS(NsProject %s at %s: s ssourcestargets state_files%s = %s(sselfsnamesrootdirsjoinsappends_[1]svsgetattr(sselfs_[1]sv((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pys__str__dscCsίdkl}dkl}l}l} l} dkl}l }l }l }l } l }|ii|idtƒ|_|ii|iddƒ}| | |ƒƒ|_||iƒ o||iƒn|ii|idƒ|_|i o d|_n||i|idƒ|_|d |iƒ|_|ii|id ƒo|ii|ƒn|d ƒ}||ii|id d dtƒ|ii|idddtƒƒ} ||iƒ|_|ii| ƒ|ii|ƒ|i|iƒ|idƒ|_ |idƒ|_!|ii|id|idƒ}||i|i!i#|ƒƒ}t$||iƒ|_%|ii&|idƒ}y8gi(}|D]}||ii+|ƒqŽ~|_,Wn4t-j o(}t/d|it0|ƒfƒ‚nX|ii&|idƒ} y8gi(}| D]}||ii+|ƒq~|_2Wn4t-j o(}t/d|it0|ƒfƒ‚nX|ii|idtƒ oK|ƒ}t|_4x6|i5D]'}t7|| ƒo|i|ƒq¬q¬WndS(sC Load relevant information from the configuration. (smakedirs(sjoinsexistss expandusersabspath(s getLoggersCRITICALsDEBUGs FileHandlers StreamHandlers Formattersverbosesroot-directorys.ssubdirs.logstailor.project.%ssdebugstailors log-formats'%(asctime)s %(levelname)8s: %(message)ssraws log-datefmts%Y-%m-%d %H:%M:%Sssourcestargets state-files.states before-commits:Project "%s" before-commit references unknown function: %ss after-commits9Project "%s" after-commit references unknown function: %sN(8sossmakedirssos.pathsjoinsexistss expandusersabspathsloggings getLoggersCRITICALsDEBUGs FileHandlers StreamHandlers FormattersselfsconfigsgetsnamesFalsesverbosesrootdirssubdirslogfileslogssetLevels tailorlogsTrues formatters loghandlers setFormatters addHandlers_Project__loadRepositoryssourcestargetssfpaths stateFilePaths StateFiles state_filesgetTuplesbeforesappends_[1]sfs namespaces before_commitsKeyErrorsesConfigurationErrorsstrsafters after_commitsrootlogsdisabledshandlersshs isinstance(sselfsexistssrootlogs Formatterssfpathsbefores FileHandlersmakedirssCRITICALs StreamHandlers formatters expandusersabspathsaftersrootdirsDEBUGsjoinsfshs tailorlogs_[1]s getLoggerse((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pys_loadis\ +    $"8$8$   cCs;|itj o'dkl}|dƒi|iƒndS(N(s getLoggerstailor(sselfs loghandlersNonesloggings getLoggers removeHandler(sselfs getLogger((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pys__del__ͺs cCsZdkl}|ii|i|ƒ}|idƒo||i7}n||||ƒSdS(s± Given a repository named 'somekind:somename', return a Repository (or a subclass of it, if 'SomekindRepository' exists) instance that wraps it. (s Repositorys:N( s repositorys Repositorysselfsconfigsgetsnameswhichsrepnamesendswith(sselfswhichs Repositorysrepname((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pys__loadRepository―s  cCs|iiƒtj SdS(sE Return True if the project exists, False otherwise. N(sselfs state_fileslastAppliedChangesetsNone(sself((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pysexists½scCsjdkl}|itjoB||i|iƒ|_|ii|iƒ|ii |i ƒn|iSdS(sB Return a DualWorkingDir instance, ready to work. (sDualWorkingDirN( sdualwdsDualWorkingDirsselfsdwdsNonessourcestargets setStateFiles state_files setLogfileslogfile(sselfsDualWorkingDir((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pys workingDirΔs ( s__name__s __module__s__doc__s__init__s__str__s_loads__del__s_Project__loadRepositorysexistss workingDir(((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pysProjects 4   A   N( s__doc__s __docformat__svcpxsTailorExceptions vcpx.configsConfigurationErrorsvcpx.statefiles StateFilesUnknownProjectErrorsobjectsProject(s StateFilesConfigurationErrorsProjectsUnknownProjectErrors __docformat__sTailorException((sB/mnt/gmirror/ports/devel/tailor/work/tailor-0.9.29/vcpx/project.pys? s