Changeset 891 in tailor


Ignore:
Timestamp:
10/12/05 16:50:22 (8 years ago)
Author:
lele@…
Hash name:
20051012145022-7a6fb-072a6272a0d41366e0077494a8d03bec053ade13
Message:

Verify that the URL points to the Subversion repository root
This is a major source of failure, since the svn log parser needs to
know the root of the repository to be able to properly recognize
entries path names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/svn.py

    r873 r891  
    1616     ChangesetApplicationFailure, GetUpstreamChangesetsFailure 
    1717from target import SyncronizableTargetWorkingDir, TargetInitializationFailure 
     18from config import ConfigurationError 
    1819 
    1920def changesets_from_svnlog(log, repository, module): 
     
    270271        from os.path import join, exists 
    271272 
     273        # Verify that the we have the root of the repository: do that 
     274        # iterating an "svn ls" over the hierarchy until one fails 
     275 
     276        cmd = self.repository.command("ls") 
     277        svnls = ExternalCommand(command=cmd) 
     278        svnls.execute(self.repository.repository) 
     279 
     280        lastok = self.repository.repository 
     281        reporoot = lastok[:lastok.rfind('/')] 
     282        while '/' in reporoot: 
     283            svnls.execute(reporoot) 
     284            if svnls.exit_status: 
     285                break 
     286            lastok = reporoot 
     287            reporoot = reporoot[:reporoot.rfind('/')] 
     288 
     289        if lastok <> self.repository.repository: 
     290            module = self.repository.repository[len(lastok):] 
     291            module += self.repository.module 
     292            raise ConfigurationError("Non-root svn repository %r. " 
     293                                     "Please specify that as 'repository=%s' " 
     294                                     "and 'module=%s'." % 
     295                                     (self.repository.repository, 
     296                                      lastok, module.rstrip('/'))) 
     297 
    272298        if revision == 'INITIAL': 
    273299            initial = True 
Note: See TracChangeset for help on using the changeset viewer.