Ejemplo n.º 1
0
 def _load(self, project):
     Repository._load(self, project)
     cget = project.config.get
     self.EXECUTABLE = cget(self.name, 'darcs-command', 'darcs')
     self.use_look_for_adds = cget(self.name, 'look-for-adds', 'False')
     self.replace_badchars = eval(cget(self.name, 'replace-badchars',
                                       "{"
                                       "'\xc1': 'Á',"
                                       "'\xc9': 'É',"
                                       "'\xcd': 'Í',"
                                       "'\xd3': 'Ó',"
                                       "'\xd6': 'Ö',"
                                       "'\xd5': 'Ő',"
                                       "'\xda': 'Ú',"
                                       "'\xdc': 'Ü',"
                                       "'\xdb': 'Ű',"
                                       "'\xe1': 'á',"
                                       "'\xe9': 'é',"
                                       "'\xed': 'í',"
                                       "'\xf3': 'ó',"
                                       "'\xf6': 'ö',"
                                       "'\xf5': 'ő',"
                                       "'\xfa': 'ú',"
                                       "'\xfc': 'ü',"
                                       "'\xfb': 'ű',"
                                       "'\xf1': 'ñ',"
                                       "'\xdf': 'ß',"
                                       "'\xe5': 'å'"
                                       "}"))
Ejemplo n.º 2
0
    def _load(self, project):
        Repository._load(self, project)
        self.EXECUTABLE = project.config.get(self.name, 'p4-command', 'p4')
        self.depot_path = project.config.get(self.name, 'depot-path')
        self.p4client = project.config.get(self.name, 'p4-client', None)
        self.p4port = project.config.get(self.name, 'p4-port', None)

        self.env = {}
Ejemplo n.º 3
0
Archivo: bzr.py Proyecto: yut148/tailor
    def _load(self, project):
        Repository._load(self, project)
        ppath = project.config.get(self.name, 'python-path')
        if ppath:
            from sys import path

            if ppath not in path:
                path.insert(0, ppath)
Ejemplo n.º 4
0
Archivo: bzr.py Proyecto: lelit/tailor
    def _load(self, project):
        Repository._load(self, project)
        ppath = project.config.get(self.name, 'python-path')
        if ppath:
            from sys import path

            if ppath not in path:
                path.insert(0, ppath)
Ejemplo n.º 5
0
    def _validateConfiguration(self):
        """
        Mercurial expects all data to be in utf-8, so we disallow other encodings
        """
        Repository._validateConfiguration(self)

        if self.encoding.upper() != 'UTF-8':
            self.log.warning("Forcing UTF-8 encoding instead of " + self.encoding)
            self.encoding = 'UTF-8'
Ejemplo n.º 6
0
Archivo: hg.py Proyecto: lelit/tailor
    def _validateConfiguration(self):
        """
        Mercurial expects all data to be in utf-8, so we disallow other encodings
        """
        Repository._validateConfiguration(self)

        if self.encoding.upper() != 'UTF-8':
            self.log.warning("Forcing UTF-8 encoding instead of " + self.encoding)
            self.encoding = 'UTF-8'
Ejemplo n.º 7
0
    def _load(self, project):
        from datetime import timedelta

        Repository._load(self, project)
        self.EXECUTABLE = project.config.get(self.name, 'cvs-command', 'cvs')
        self.__cvsps = project.config.get(self.name, 'cvsps-command', 'cvsps')
        self.tag_entries = project.config.get(self.name, 'tag-entries', 'True')
        self.freeze_keywords = project.config.get(self.name, 'freeze-keywords', 'False')
        threshold = project.config.get(self.name, 'changeset-threshold', '180')
        self.changeset_threshold = timedelta(seconds=float(threshold))
Ejemplo n.º 8
0
    def _load(self, project):
        from datetime import timedelta

        Repository._load(self, project)
        self.EXECUTABLE = project.config.get(self.name, 'cvs-command', 'cvs')
        self.__cvsps = project.config.get(self.name, 'cvsps-command', 'cvsps')
        self.tag_entries = project.config.get(self.name, 'tag-entries', 'True')
        self.freeze_keywords = project.config.get(self.name, 'freeze-keywords',
                                                  'False')
        threshold = project.config.get(self.name, 'changeset-threshold', '180')
        self.changeset_threshold = timedelta(seconds=float(threshold))
Ejemplo n.º 9
0
 def _load(self, project):
     Repository._load(self, project)
     cget = project.config.get
     self.EXECUTABLE = cget(self.name, 'monotone-command', 'mtn')
     self.keyid = cget(self.name, 'keyid') or \
                  cget(self.name, '%s-keyid' % self.which)
     self.passphrase = cget(self.name, 'passphrase') or \
                       cget(self.name, '%s-passphrase' % self.which)
     self.keygenid = cget(self.name, 'keygenid') or \
                     cget(self.name, '%s-keygenid' % self.which)
     self.custom_lua = (cget(self.name, 'custom-lua') or
                        cget(self.name, '%s-custom-lua' % self.which) or
                        # for backward compatibility
                        cget(self.name, 'custom_lua') or
                        cget(self.name, '%s-custom_lua' % self.which))
Ejemplo n.º 10
0
 def _load(self, project):
     Repository._load(self, project)
     cget = project.config.get
     self.EXECUTABLE = cget(self.name, 'svn-command', 'svn')
     self.__svnadmin = cget(self.name, 'svnadmin-command', 'svnadmin')
     self.use_propset = cget(self.name, 'use-propset', False)
     self.propset_date = cget(self.name, 'propset-date', True)
     self.filter_badchars = cget(self.name, 'filter-badchars', False)
     self.use_limit = cget(self.name, 'use-limit', True)
     self.trust_root = cget(self.name, 'trust-root', False)
     self.ignore_externals = cget(self.name, 'ignore-externals', True)
     self.commit_all_files = cget(self.name, 'commit-all-files', True)
     self.tags_path = cget(self.name, 'svn-tags', '/tags')
     self.branches_path = cget(self.name, 'svn-branches', '/branches')
     self._setupTagsDirectory = None
Ejemplo n.º 11
0
 def _load(self, project):
     Repository._load(self, project)
     cget = project.config.get
     self.EXECUTABLE = cget(self.name, 'svn-command', 'svn')
     self.__svnadmin = cget(self.name, 'svnadmin-command', 'svnadmin')
     self.use_propset = cget(self.name, 'use-propset', False)
     self.propset_date = cget(self.name, 'propset-date', True)
     self.filter_badchars = cget(self.name, 'filter-badchars', False)
     self.use_limit = cget(self.name, 'use-limit', True)
     self.trust_root = cget(self.name, 'trust-root', False)
     self.ignore_externals = cget(self.name, 'ignore-externals', True)
     self.commit_all_files = cget(self.name, 'commit-all-files', True)
     self.tags_path = cget(self.name, 'svn-tags', '/tags')
     self.branches_path = cget(self.name, 'svn-branches', '/branches')
     self._setupTagsDirectory = None
Ejemplo n.º 12
0
 def _load(self, project):
     Repository._load(self, project)
     cget = project.config.get
     self.EXECUTABLE = cget(self.name, 'monotone-command', 'mtn')
     self.keyid = cget(self.name, 'keyid') or \
                  cget(self.name, '%s-keyid' % self.which)
     self.passphrase = cget(self.name, 'passphrase') or \
                       cget(self.name, '%s-passphrase' % self.which)
     self.keygenid = cget(self.name, 'keygenid') or \
                     cget(self.name, '%s-keygenid' % self.which)
     self.custom_lua = (
         cget(self.name, 'custom-lua')
         or cget(self.name, '%s-custom-lua' % self.which) or
         # for backward compatibility
         cget(self.name, 'custom_lua')
         or cget(self.name, '%s-custom_lua' % self.which))
Ejemplo n.º 13
0
    def _load(self, project):
        from os.path import join

        Repository._load(self, project)
        cget = project.config.get
        self.EXECUTABLE = cget(self.name, 'darcs-command', 'darcs')
        self._darcs_version = None
        init_options = cget(self.name, 'init-options', '')
        if init_options:
            self.init_options = tuple(init_options.split(' '))
        else:
            self.init_options = None
        self.use_look_for_adds = cget(self.name, 'look-for-adds', 'False')
        self.metadir = join(self.basedir,
                            cget(self.name, 'metadir', self.METADIR))
        self.split_initial_import_level = int(
            cget(self.name, 'split-initial-changeset-level', '0'))
        self.replace_badchars = eval(
            cget(
                self.name, 'replace-badchars', "{"
                "'\xb4': '´',"
                "'\xc1': 'Á',"
                "'\xc4': 'Ä',"
                "'\xc5': 'Å',"
                "'\xc9': 'É',"
                "'\xcd': 'Í',"
                "'\xd3': 'Ó',"
                "'\xd5': 'Ő',"
                "'\xd6': 'Ö',"
                "'\xda': 'Ú',"
                "'\xdb': 'Ű',"
                "'\xdc': 'Ü',"
                "'\xdf': 'ß',"
                "'\xe1': 'á',"
                "'\xe5': 'å',"
                "'\xe9': 'é',"
                "'\xed': 'í',"
                "'\xf1': 'ñ',"
                "'\xf3': 'ó',"
                "'\xf5': 'ő',"
                "'\xf6': 'ö',"
                "'\xfa': 'ú',"
                "'\xfb': 'ű',"
                "'\xfc': 'ü',"
                "}"))
Ejemplo n.º 14
0
    def _validateConfiguration(self):
        from os.path import split
        from vcpx.config import ConfigurationError

        Repository._validateConfiguration(self)

        if not self.module and self.repository:
            self.module = split(self.repository)[1]

        if not self.module:
            self.log.critical('Missing module information in %r', self.name)
            raise ConfigurationError("Must specify a repository and maybe "
                                     "a module also")

        if self.module.endswith('/'):
            self.log.debug("Removing final slash from %r in %r",
                           self.module, self.name)
            self.module = self.module.rstrip('/')
Ejemplo n.º 15
0
    def _validateConfiguration(self):
        from os.path import split
        from vcpx.config import ConfigurationError

        Repository._validateConfiguration(self)

        if not self.module and self.repository:
            self.module = split(self.repository)[1]

        if not self.module:
            self.log.critical('Missing module information in %r', self.name)
            raise ConfigurationError("Must specify a repository and maybe "
                                     "a module also")

        if self.module.endswith('/'):
            self.log.debug("Removing final slash from %r in %r", self.module,
                           self.name)
            self.module = self.module.rstrip('/')
Ejemplo n.º 16
0
    def _load(self, project):
        Repository._load(self, project)
        self.EXECUTABLE = project.config.get(self.name, 'git-command', 'git')
        self.overwrite_tags = project.config.get(self.name, 'overwrite-tags',
                                                 False)
        self.parent_repo = project.config.get(self.name, 'parent-repo')
        self.branch_point = project.config.get(self.name, 'branchpoint',
                                               'HEAD')
        self.branch_name = project.config.get(self.name, 'branch')
        if self.branch_name:
            self.branch_name = 'refs/heads/' + self.branch_name

        if self.repository and self.parent_repo:
            self.log.critical(
                'Cannot make sense of both "repository" and "parent-repo" parameters'
            )
            raise ConfigurationError(
                'Must specify only one of "repository" and "parent-repo"')

        if self.branch_name and not self.repository:
            self.log.critical(
                'Cannot make sense of "branch" if "repository" is not set')
            raise ConfigurationError(
                'Missing "repository" to make use o "branch"')

        self.env = {}

        # The git storage directory can track both the repository and
        # the working directory.  If the repository directory is
        # specified, make sure git stores its repository there by
        # setting $GIT_DIR.  However, this repository will typically be
        # a "bare" repository that can't directly track a working
        # directory.  As such, it is necessary to tell it where to find
        # the working directory and index through $GIT_WORK_TREE and
        # $GIT_INDEX_FILE.

        if self.repository:
            from os.path import join
            self.storagedir = self.repository
            self.env['GIT_DIR'] = self.storagedir
            self.env['GIT_INDEX_FILE'] = join(self.METADIR, 'index')
            self.env['GIT_WORK_TREE'] = self.basedir
        else:
            self.storagedir = self.METADIR
Ejemplo n.º 17
0
    def _load(self, project):
        from os.path import join

        Repository._load(self, project)
        cget = project.config.get
        self.EXECUTABLE = cget(self.name, 'darcs-command', 'darcs')
        self._darcs_version = None
        init_options = cget(self.name, 'init-options', '')
        if init_options:
            self.init_options = tuple(init_options.split(' '))
        else:
            self.init_options = None
        self.use_look_for_adds = cget(self.name, 'look-for-adds', 'False')
        self.metadir = join(self.basedir, cget(
            self.name, 'metadir', self.METADIR))
        self.split_initial_import_level = int(
            cget(self.name, 'split-initial-changeset-level', '0'))
        self.replace_badchars = eval(cget(self.name, 'replace-badchars',
                                          "{"
                                          "'\xb4': '´',"
                                          "'\xc1': 'Á',"
                                          "'\xc4': 'Ä',"
                                          "'\xc5': 'Å',"
                                          "'\xc9': 'É',"
                                          "'\xcd': 'Í',"
                                          "'\xd3': 'Ó',"
                                          "'\xd5': 'Ő',"
                                          "'\xd6': 'Ö',"
                                          "'\xda': 'Ú',"
                                          "'\xdb': 'Ű',"
                                          "'\xdc': 'Ü',"
                                          "'\xdf': 'ß',"
                                          "'\xe1': 'á',"
                                          "'\xe5': 'å',"
                                          "'\xe9': 'é',"
                                          "'\xed': 'í',"
                                          "'\xf1': 'ñ',"
                                          "'\xf3': 'ó',"
                                          "'\xf5': 'ő',"
                                          "'\xf6': 'ö',"
                                          "'\xfa': 'ú',"
                                          "'\xfb': 'ű',"
                                          "'\xfc': 'ü',"
                                          "}"))
Ejemplo n.º 18
0
    def _validateConfiguration(self):
        from vcpx.config import ConfigurationError

        Repository._validateConfiguration(self)

        if not self.repository:
            self.log.critical('Missing repository information in %r',
                              self.name)
            raise ConfigurationError("Must specify the root of the "
                                     "Subversion repository used "
                                     "as %s with the option "
                                     "'repository'" % self.which)
        elif self.repository.endswith('/'):
            self.log.debug("Removing final slash from %r in %r",
                           self.repository, self.name)
            self.repository = self.repository.rstrip('/')

        if not self.module:
            self.log.critical('Missing module information in %r', self.name)
            raise ConfigurationError("Must specify the path within the "
                                     "Subversion repository as 'module'")

        if self.module == '.':
            self.log.warning("Replacing '.' with '/' in module name in %r",
                             self.name)
            self.module = '/'
        elif not self.module.startswith('/'):
            self.log.debug("Prepending '/' to module %r in %r", self.module,
                           self.name)
            self.module = '/' + self.module

        if not self.tags_path.startswith('/'):
            self.log.debug("Prepending '/' to svn-tags %r in %r",
                           self.tags_path, self.name)
            self.tags_path = '/' + self.tags_path

        if not self.branches_path.startswith('/'):
            self.log.debug("Prepending '/' to svn-branches %r in %r",
                           self.branches_path, self.name)
            self.branches_path = '/' + self.branches_path
Ejemplo n.º 19
0
    def _validateConfiguration(self):
        from vcpx.config import ConfigurationError

        Repository._validateConfiguration(self)

        if not self.repository:
            self.log.critical('Missing repository information in %r', self.name)
            raise ConfigurationError("Must specify the root of the "
                                     "Subversion repository used "
                                     "as %s with the option "
                                     "'repository'" % self.which)
        elif self.repository.endswith('/'):
            self.log.debug("Removing final slash from %r in %r",
                           self.repository, self.name)
            self.repository = self.repository.rstrip('/')

        if not self.module:
            self.log.critical('Missing module information in %r', self.name)
            raise ConfigurationError("Must specify the path within the "
                                     "Subversion repository as 'module'")

        if self.module == '.':
            self.log.warning("Replacing '.' with '/' in module name in %r",
                             self.name)
            self.module = '/'
        elif not self.module.startswith('/'):
            self.log.debug("Prepending '/' to module %r in %r",
                           self.module, self.name)
            self.module = '/' + self.module

        if not self.tags_path.startswith('/'):
            self.log.debug("Prepending '/' to svn-tags %r in %r",
                           self.tags_path, self.name)
            self.tags_path = '/' + self.tags_path

        if not self.branches_path.startswith('/'):
            self.log.debug("Prepending '/' to svn-branches %r in %r",
                           self.branches_path, self.name)
            self.branches_path = '/' + self.branches_path
Ejemplo n.º 20
0
    def _load(self, project):
        Repository._load(self, project)
        self.EXECUTABLE = project.config.get(self.name, "git-command", "git")
        self.overwrite_tags = project.config.get(self.name, "overwrite-tags", False)
        self.parent_repo = project.config.get(self.name, "parent-repo")
        self.branch_point = project.config.get(self.name, "branchpoint", "HEAD")
        self.branch_name = project.config.get(self.name, "branch")
        if self.branch_name:
            self.branch_name = "refs/heads/" + self.branch_name

        if self.repository and self.parent_repo:
            self.log.critical('Cannot make sense of both "repository" and "parent-repo" parameters')
            raise ConfigurationError('Must specify only one of "repository" and "parent-repo"')

        if self.branch_name and not self.repository:
            self.log.critical('Cannot make sense of "branch" if "repository" is not set')
            raise ConfigurationError('Missing "repository" to make use o "branch"')

        self.env = {}

        # The git storage directory can track both the repository and
        # the working directory.  If the repository directory is
        # specified, make sure git stores its repository there by
        # setting $GIT_DIR.  However, this repository will typically be
        # a "bare" repository that can't directly track a working
        # directory.  As such, it is necessary to tell it where to find
        # the working directory and index through $GIT_WORK_TREE and
        # $GIT_INDEX_FILE.

        if self.repository:
            from os.path import join

            self.storagedir = self.repository
            self.env["GIT_DIR"] = self.storagedir
            self.env["GIT_INDEX_FILE"] = join(self.METADIR, "index")
            self.env["GIT_WORK_TREE"] = self.basedir
        else:
            self.storagedir = self.METADIR
Ejemplo n.º 21
0
    def _load(self, project):
        Repository._load(self, project)
        self.EXECUTABLE = project.config.get(self.name, 'git-command', 'git')
        self.overwrite_tags = project.config.get(self.name, 'overwrite-tags', False)
        self.parent_repo = project.config.get(self.name, 'parent-repo')
        self.branch_point = project.config.get(self.name, 'branchpoint', 'HEAD')
        self.branch_name = project.config.get(self.name, 'branch')
        if self.branch_name:
            self.branch_name = 'refs/heads/' + self.branch_name

        if self.repository and self.parent_repo:
            self.log.critical('Cannot make sense of both "repository" and "parent-repo" parameters')
            raise ConfigurationError ('Must specify only one of "repository" and "parent-repo"')

        if self.branch_name and not self.repository:
            self.log.critical('Cannot make sense of "branch" if "repository" is not set')
            raise ConfigurationError ('Missing "repository" to make use o "branch"')

        self.env = {}

        # XXX: this seems plain wrong to me [who does not know git at
        # all!]: why storagedir gets set to repository here? and why
        # the need for the GIT_DIR envvar? I fail to see when
        # storagedir should be different from '.git', the default,
        # given how it's being used by this class! The same with
        # GIT_INDEX_FILE, that accordingly with the man page defaults
        # to ".git/index" anyway...
        #
        self.storagedir = self.METADIR
        if self.repository:
            from os.path import join

            #self.storagedir = self.repository
            #self.env['GIT_DIR'] = self.storagedir
            self.env['GIT_DIR'] = join(self.basedir, self.METADIR)
            self.env['GIT_INDEX_FILE'] = self.METADIR + '/index'
Ejemplo n.º 22
0
    def command(self, *args, **kwargs):
        #
        # Run aegis in verbose mode
        #
        args = args + ('-verbose', )

        #
        # Disable the log file functionality
        #
        if not kwargs.has_key('env'):
            kwargs['env'] = {}
        kwargs['env']['AEGIS_FLAGS'] = "log_file_preference = never;"

        #
        # aefinish is a different executable.  Take care of it.
        #
        original_command = self.EXECUTABLE
        if args[0] == "-finish":
            self.EXECUTABLE = "aefinish"
            args = args[1:]

        rc = Repository.command(self, *args, **kwargs)
        self.EXECUTABLE = original_command
        return rc
Ejemplo n.º 23
0
    def command(self, *args, **kwargs):
        #
        # Run aegis in verbose mode
        #
        args = args + ('-verbose',)

        #
        # Disable the log file functionality
        #
        if not kwargs.has_key('env'):
            kwargs['env'] = {}
        kwargs['env']['AEGIS_FLAGS'] = "log_file_preference = never;"

        #
        # aefinish is a different executable.  Take care of it.
        #
        original_command = self.EXECUTABLE
        if args[0] == "-finish":
            self.EXECUTABLE = "aefinish"
            args = args[1:]

        rc = Repository.command(self, *args, **kwargs)
        self.EXECUTABLE = original_command
        return rc
Ejemplo n.º 24
0
 def command(self, *args, **kwargs):
     if kwargs.get('svnadmin', False):
         kwargs['executable'] = self.__svnadmin
     return Repository.command(self, *args, **kwargs)
Ejemplo n.º 25
0
Archivo: tla.py Proyecto: yut148/tailor
 def _load(self, project):
     Repository._load(self, project)
     self.EXECUTABLE = project.config.get(self.name, 'tla-command', 'tla')
     self.IGNORE_IDS = project.config.get(self.name, 'ignore-ids', False)
     self.EXTRA_METADIRS = ['.arch-ids']
Ejemplo n.º 26
0
 def command(self, *args, **kwargs):
     if args[0] == 'record' and self.use_look_for_adds:
         args = args + ('--look-for-adds',)
     elif args[0] == 'initialize' and self.init_options:
         args = args + self.init_options
     return Repository.command(self, *args, **kwargs)
Ejemplo n.º 27
0
 def _load(self, project):
     Repository._load(self, project)
     cget = project.config.get
     self.EXECUTABLE = cget(self.name, 'aegis-command', 'aegis')
Ejemplo n.º 28
0
 def _load(self, project):
     Repository._load(self, project)
     self.EXECUTABLE = project.config.get(self.name, 'cdv-command', 'cdv')
Ejemplo n.º 29
0
 def _load(self, project):
     Repository._load (self, project)
     cget = project.config.get
     self.EXECUTABLE = cget(self.name, 'aegis-command', 'aegis')
Ejemplo n.º 30
0
 def _load(self, project):
     Repository._load(self, project)
     self.EXECUTABLE = project.config.get(self.name, 'tla-command', 'tla')
     self.IGNORE_IDS = project.config.get(self.name, 'ignore-ids', False)
     self.EXTRA_METADIRS = ['.arch-ids']
Ejemplo n.º 31
0
 def command(self, *args, **kwargs):
     if kwargs.get('cvsps', False):
         kwargs['executable'] = self.__cvsps
     return Repository.command(self, *args, **kwargs)
Ejemplo n.º 32
0
 def command(self, *args, **kwargs):
     if args[0] == 'record' and self.use_look_for_adds:
         args = args + ('--look-for-adds', )
     elif args[0] == 'initialize' and self.init_options:
         args = args + self.init_options
     return Repository.command(self, *args, **kwargs)
Ejemplo n.º 33
0
 def command(self, *args, **kwargs):
     if args[0] == 'record' and self.use_look_for_adds:
         args = args + ('--look-for-adds',)
     return Repository.command(self, *args, **kwargs)
Ejemplo n.º 34
0
 def command(self, *args, **kwargs):
     if kwargs.get('svnadmin', False):
         kwargs['executable'] = self.__svnadmin
     return Repository.command(self, *args, **kwargs)
Ejemplo n.º 35
0
 def command(self, *args, **kwargs):
     if kwargs.get('cvsps', False):
         kwargs['executable'] = self.__cvsps
     return Repository.command(self, *args, **kwargs)