Changeset 1391 in tailor


Ignore:
Timestamp:
06/15/07 17:05:00 (6 years ago)
Author:
henry.ne@…
Hash name:
20070615150500-e66d1-311dc867097c690062eada6b41c9e191818c1e72
Message:

svn-target-branches.patch
Subversion: Supports branches as target.

Add support for 'branches' on subversion targets. Modules, that starts
with 'branches/...' will be export under "branches".
Add 'svn-branches' to config, can change the path.

Hint: The 'trunk' is non special in tailor, simple set 'trunk' as module.

Full example from Monotone source to Subversion:

[DEFAULT]
start-revision = INITIAL
root-directory = /tmp/rootdir-Monotone
source-repository = $HOME/Monotone-database-file/monotone.mtn
target-repository =  file:///tmp/rootdir-Monotone/svn-repository-monotone
use-propset = True

# Projects
[net.venge.monotone.cvssync]
source = monotone:net.venge.monotone.cvssync
target = svn:net.venge.monotone.cvssync

[net.venge.monotone.de]
source = monotone:net.venge.monotone.de
target = svn:net.venge.monotone.de

[net.venge.monotone.svn_import]
source = monotone:net.venge.monotone.svn_import
target = svn:net.venge.monotone.svn_import

[net.venge.monotone]
source = monotone:net.venge.monotone
target = svn:net.venge.monotone

# Sources
[monotone:net.venge.monotone.cvssync]
module = net.venge.monotone.cvssync
subdir = mtnside-net.venge.monotone.cvssync

[monotone:net.venge.monotone.de]
module = net.venge.monotone.de
subdir = mtnside-net.venge.monotone.de

[monotone:net.venge.monotone.svn_import]
module = net.venge.monotone.svn_import
subdir = mtnside-net.venge.monotone.svn_import

[monotone:net.venge.monotone]
module = net.venge.monotone
subdir = mtnside-net.venge.monotone

# Targets
[svn:net.venge.monotone.cvssync]
module = branches/net.venge.monotone.cvssync
subdir = svnside-net.venge.monotone.cvssync

[svn:net.venge.monotone.de]
module = branches/net.venge.monotone.de
subdir = svnside-net.venge.monotone.de

[svn:net.venge.monotone.svn_import]
module = branches/net.venge.monotone.svn_import
subdir = svnside-net.venge.monotone.svn_import

[svn:net.venge.monotone]
module = trunk
subdir = svnside-net.venge.monotone

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vcpx/repository/svn.py

    r1390 r1391  
    4141        self.commit_all_files = cget(self.name, 'commit-all-files', True) 
    4242        self.tags_path = cget(self.name, 'svn-tags', '/tags') 
     43        self.branches_path = cget(self.name, 'svn-branches', '/branches') 
    4344        self._setupTagsDirectory = None 
    4445 
     
    106107                           self.tags_path, self.name) 
    107108            self.tags_path = '/' + self.tags_path 
     109 
     110        if not self.branches_path.startswith('/'): 
     111            self.log.debug("Prepending '/' to svn-branches %r in %r", 
     112                           self.branches_path, self.name) 
     113            self.branches_path = '/' + self.branches_path 
    108114 
    109115    def create(self): 
     
    163169            svnls.execute(self.repository + self.module) 
    164170            if svnls.exit_status: 
     171 
     172                paths = [] 
     173 
     174                # Auto detect missing "branches/" 
     175                if self.module.startswith(self.branches_path + '/'): 
     176                    path = self.repository + self.branches_path 
     177                    cmd = self.command("ls") 
     178                    svnls = ExternalCommand(command=cmd) 
     179                    svnls.execute(path) 
     180                    if svnls.exit_status: 
     181                        paths.append(path) 
     182 
     183                paths.append(self.repository + self.module) 
    165184                cmd = self.command("mkdir", "-m", 
    166185                                   "This directory will host the upstream sources") 
    167186                svnmkdir = ExternalCommand(command=cmd) 
    168                 svnmkdir.execute(self.repository + self.module) 
     187                svnmkdir.execute(paths) 
    169188                if svnmkdir.exit_status: 
    170189                    raise TargetInitializationFailure("Was not able to create the " 
  • README

    r1389 r1391  
    919919  *tags* by default. 
    920920 
     921svn-branches : string 
     922  Branches will copy under that directory. 
     923 
     924  *branches* by default. 
     925 
     926  .. note:: Target module for branches **must** start with ``branches/``. 
     927            Every branch must configure in a single-repository mode. 
     928 
     929  Example: ``module = branches/branch.name`` 
     930 
    921931tla 
    922932%%% 
Note: See TracChangeset for help on using the changeset viewer.