Changeset 444 in tailor
- Timestamp:
- 07/30/05 01:31:57 (8 years ago)
- Hash name:
- 20050729233157-97f81-9f9976446c8d10842d4542094981bd4c5633199d
- File:
-
- 1 edited
-
vcpx/svn.py (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/svn.py
r433 r444 40 40 else: 41 41 return relative 42 42 43 43 # The path is outside our tracked tree... 44 44 return None 45 45 46 46 class SvnXMLLogHandler(ContentHandler): 47 47 # Map between svn action and tailor's. … … 65 65 'A': ChangesetEntry.ADDED, 66 66 'D': ChangesetEntry.DELETED} 67 67 68 68 def __init__(self): 69 69 self.changesets = [] … … 71 71 self.current_field = [] 72 72 self.renamed = {} 73 73 74 74 def startElement(self, name, attributes): 75 75 if name == 'logentry': … … 106 106 if e.action_kind == e.ADDED and e.old_name is not None: 107 107 mv_or_cp[e.old_name] = e 108 108 109 109 entries = [] 110 110 for e in self.current['entries']: … … 117 117 entries.append(e) 118 118 else: 119 entries.append(e) 120 119 entries.append(e) 120 121 121 svndate = self.current['date'] 122 122 # 2004-04-16T17:12:48.000000Z … … 125 125 ms = int(svndate[20:-1]) 126 126 timestamp = datetime(y, m, d, hh, mm, ss, ms) 127 127 128 128 changeset = Changeset(self.current['revision'], 129 129 timestamp, … … 154 154 self.current['entries'].append(entry) 155 155 156 156 157 157 def characters(self, data): 158 158 self.current_field.append(data) … … 162 162 # are illegal in an XML stream. This was the case with Twisted Matrix master 163 163 # repository. To be safe, we replace all of them with a question mark. 164 164 165 165 allbadchars = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0B\x0C\x0E\x0F\x10\x11" \ 166 166 "\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7f" … … 185 185 svnlog = ExternalCommand(cwd=root, command=cmd) 186 186 log = svnlog.execute('.', stdout=PIPE, TZ='UTC') 187 187 188 188 if svnlog.exit_status: 189 189 return [] … … 219 219 raise ChangesetApplicationFailure( 220 220 "%s returned status %s" % (str(svnup), svnup.exit_status)) 221 221 222 222 if logger: logger.info("%s updated to %s" % ( 223 223 ','.join([e.name for e in changeset.entries]), 224 224 changeset.revision)) 225 225 226 226 result = [] 227 227 for line in out: … … 229 229 logger.warn("Conflict after 'svn update': '%s'" % line) 230 230 result.append(line[2:-1]) 231 231 232 232 return result 233 233 234 234 def _checkoutUpstreamRevision(self, basedir, repository, module, revision, 235 235 subdir=None, logger=None, **kwargs): … … 237 237 Concretely do the checkout of the upstream revision. 238 238 """ 239 239 240 240 from os.path import join, exists 241 241 … … 286 286 287 287 last = csets[0] 288 288 289 289 if logger: logger.info("working copy up to svn revision %s", 290 290 last.revision) 291 291 292 292 return last 293 293 294 294 ## SyncronizableTargetWorkingDir 295 295 … … 314 314 315 315 return entries 316 316 317 317 def _commit(self,root, date, author, remark, changelog=None, entries=None): 318 318 """ … … 321 321 322 322 from sys import getdefaultencoding 323 323 324 324 encoding = ExternalCommand.FORCE_ENCODING or getdefaultencoding() 325 325 326 326 logmessage = [] 327 327 if remark: … … 334 334 # If we cannot use propset, fall back to old behaviour of 335 335 # appending these info to the changelog 336 336 337 337 if not self.USE_PROPSET: 338 338 logmessage.append('') … … 340 340 logmessage.append('Date: %s' % date) 341 341 logmessage.append('') 342 342 343 343 rontf = ReopenableNamedTemporaryFile('svn', 'tailor') 344 344 log = open(rontf.name, "w") 345 345 log.write('\n'.join(logmessage)) 346 log.close() 346 log.close() 347 347 348 348 cmd = [SVN_CMD, "commit", "--quiet", "--file", rontf.name] 349 349 commit = ExternalCommand(cwd=root, command=cmd) 350 350 351 351 if not entries: 352 352 entries = ['.'] 353 353 354 354 commit.execute(entries) 355 355
Note: See TracChangeset
for help on using the changeset viewer.
