Changeset 46 in tailor
- Timestamp:
- 07/05/04 16:02:13 (9 years ago)
- Hash name:
- 20040705140213-97f81-a71dbf81825ae1ceec4042065e6d152d80c82bbf
- Location:
- vcpx
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
vcpx/cvs.py
r44 r46 285 285 286 286 c = CvsCommit(working_dir=root) 287 288 if entries: 289 entries = ' '.join(entries) 290 else: 291 entries = '.' 292 287 293 c(entries=entries, logfile=log.name) 288 294 log.close() -
vcpx/target.py
r44 r46 17 17 HOST = socket.getfqdn() 18 18 AUTHOR = "tailor" 19 20 class TargetInitializationFailure(Exception): 21 pass 19 22 20 23 class SyncronizableTargetWorkingDir(object): … … 95 98 raise "%s should override this method" % self.__class__ 96 99 97 def initializeNewWorkingDir(self, root, repository, revision):100 def initializeNewWorkingDir(self, root, repository, module, revision): 98 101 """ 99 Initialize a new working directory, just extracted under102 Initialize a new working directory, just extracted from 100 103 some other VC system, importing everything's there. 101 104 """ … … 104 107 105 108 now = datetime.now() 106 self._initializeWorkingDir(root )109 self._initializeWorkingDir(root, module) 107 110 self._commit(root, now, '%s@%s' % (AUTHOR, HOST), 108 'Tailorization of %s@%s' % (repository, revision)) 111 'Tailorization of %s' % module, 112 'Upstream sources from %s at revision %s' % (repository, 113 revision), 114 entries=[module]) 109 115 110 def _initializeWorkingDir(self, root, addentry=None):116 def _initializeWorkingDir(self, root, module, addentry=None): 111 117 """ 112 Assuming the `root` directory is a working copy extracted113 from some VC repository, add it and all its content to the114 t arget repository.118 Assuming the `root` directory contains a working copy `module` 119 extracted from some VC repository, add it and all its content 120 to the target repository. 115 121 116 122 This implementation first runs the given `addentry` … … 126 132 assert addentry, "Subclass should have specified something as addentry" 127 133 128 from os.path import split 134 from os.path import split, join 129 135 from os import walk 130 136 131 basedir,wdir = split(root) 132 c = addentry(working_dir=basedir) 133 c(entry=repr(wdir)) 137 c = addentry(working_dir=root) 138 c(entry=repr(module)) 134 139 135 for dir, subdirs, files in walk( root):140 for dir, subdirs, files in walk(join(root, module)): 136 141 for excd in ['.svn', '_darcs', 'CVS']: 137 142 if excd in subdirs: -
vcpx/darcs.py
r44 r46 22 22 23 23 class DarcsRecord(SystemCommand): 24 COMMAND = "darcs record --all --look-for-adds --pipe "24 COMMAND = "darcs record --all --look-for-adds --pipe %(entries)s" 25 25 26 26 def __call__(self, output=None, dry_run=False, **kwargs): … … 210 210 211 211 c = DarcsRecord(working_dir=root) 212 213 if entries: 214 entries = ' '.join(entries) 215 else: 216 entries = '.' 217 212 218 c(output=True, date=date, patchname=remark, 213 logmessage=changelog, author=author )219 logmessage=changelog, author=author, entries=entries) 214 220 215 221 def _removeEntry(self, root, entry): … … 228 234 c = DarcsMv(working_dir=root) 229 235 c(old=oldentry, new=newentry) 230 231 def initializeNewWorkingDir(self, root, repository, revision):232 """233 Initialize the new repository and create a tag.234 """235 236 SyncronizableTargetWorkingDir.initializeNewWorkingDir(self,237 root,238 repository,239 revision)240 #self._createTag(root, 'Upstream revision %s' % revision)241 236 242 237 def _createTag(self, root, tagname): … … 270 265 return tagname 271 266 272 def _initializeWorkingDir(self, root ):267 def _initializeWorkingDir(self, root, module): 273 268 """ 274 269 Execute `darcs initialize`. -
vcpx/svn.py
r44 r46 14 14 from shwrap import SystemCommand 15 15 from source import UpdatableSourceWorkingDir 16 from target import SyncronizableTargetWorkingDir 16 from target import SyncronizableTargetWorkingDir, TargetInitializationFailure 17 17 18 18 … … 81 81 82 82 class SvnCommit(SystemCommand): 83 COMMAND = "svn commit -- file %(logfile)s %(entries)s"83 COMMAND = "svn commit --quiet --file %(logfile)s %(entries)s" 84 84 85 85 def __call__(self, output=None, dry_run=False, **kwargs): … … 282 282 c(old=oldentry, new=newentry) 283 283 284 def _initializeWorkingDir(self, root, addentry=None):284 def _initializeWorkingDir(self, root, module, addentry=None): 285 285 """ 286 286 Add the given directory to an already existing svn working tree. 287 287 """ 288 289 SyncronizableTargetWorkingDir._initializeWorkingDir(self, root, SvnAdd) 288 289 from os.path import exists, join 290 291 if not exists(join(root, '.svn')): 292 raise TargetInitializationFailure("'%s' should already be under SVN" % root) 293 294 SyncronizableTargetWorkingDir._initializeWorkingDir(self, root, module, 295 SvnAdd) -
vcpx/dualwd.py
r44 r46 52 52 ## SyncronizableTargetWorkingDir 53 53 54 def initializeNewWorkingDir(self, root, repository, revision):55 self.target.initializeNewWorkingDir(root, repository, revision)54 def initializeNewWorkingDir(self, root, repository, module, revision): 55 self.target.initializeNewWorkingDir(root, repository, module, revision) -
vcpx/tailor.py
r45 r46 101 101 module, revision) 102 102 self.logger.info("initializing %s shadow" % target_kind) 103 dwd.initializeNewWorkingDir(self.root, repository, actual)103 dwd.initializeNewWorkingDir(self.root, repository, module, actual) 104 104 105 105 self.source_kind = source_kind
Note: See TracChangeset
for help on using the changeset viewer.
