Changeset 39 in tailor
- Timestamp:
- 06/27/04 03:59:28 (9 years ago)
- Hash name:
- 20040627015928-97f81-db032f1503420bba9d7a0706ce5394be055cdd1e
- File:
-
- 1 edited
-
vcpx/cvs.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/cvs.py
r37 r39 117 117 changesets = [] 118 118 log = cvsps(output=True, update=True, branch=branch) 119 for cs in self.__enumerateChangesets(log): 120 if not startfrom_rev or (startfrom_rev<=int(cs.revision)): 121 changesets.append(cs) 119 for cs in self.__enumerateChangesets(log, startfrom_rev): 120 changesets.append(cs) 122 121 123 122 return changesets 124 123 125 def __enumerateChangesets(self, log ):124 def __enumerateChangesets(self, log, startfrom_rev): 126 125 """ 127 126 Parse CVSps log. … … 179 178 180 179 while l.startswith('\t'): 181 file,revs = l[1:-1].split(':') 182 fromrev,torev = revs.split('->') 183 184 e = ChangesetEntry(file) 185 e.old_revision = fromrev 186 e.new_revision = torev 187 188 if fromrev=='INITIAL': 189 e.action_kind = e.ADDED 190 elif "(DEAD)" in torev: 191 e.action_kind = e.DELETED 192 else: 193 e.action_kind = e.UPDATED 194 195 entries.append(e) 180 if not startfrom_rev or (startfrom_rev<=int(pset['revision'])): 181 file,revs = l[1:-1].split(':') 182 fromrev,torev = revs.split('->') 183 184 e = ChangesetEntry(file) 185 e.old_revision = fromrev 186 e.new_revision = torev 187 188 if fromrev=='INITIAL': 189 e.action_kind = e.ADDED 190 elif "(DEAD)" in torev: 191 e.action_kind = e.DELETED 192 else: 193 e.action_kind = e.UPDATED 194 195 entries.append(e) 196 196 197 l = log.readline() 197 198 198 cvsdate = pset['date'] 199 y,m,d = map(int, cvsdate[:10].split('/')) 200 hh,mm,ss = map(int, cvsdate[11:19].split(':')) 201 timestamp = datetime(y, m, d, hh, mm, ss) 202 pset['date'] = timestamp 199 if not startfrom_rev or (startfrom_rev<=int(pset['revision'])): 200 cvsdate = pset['date'] 201 y,m,d = map(int, cvsdate[:10].split('/')) 202 hh,mm,ss = map(int, cvsdate[11:19].split(':')) 203 timestamp = datetime(y, m, d, hh, mm, ss) 204 pset['date'] = timestamp 203 205 204 yield Changeset(**pset)206 yield Changeset(**pset) 205 207 206 208 def _applyChangeset(self, root, changeset): 209 from os.path import join, exists, dirname 210 from os import makedirs 211 207 212 cvsup = CvsUpdate(working_dir=root) 208 213 for e in changeset.entries: 214 edir = dirname(join(root, e.name)) 215 if e.action_kind != e.DELETED and not exists(edir)): 216 makedirs(edir) 217 209 218 cvsup(entry=e.name, revision=e.new_revision) 219 220 if e.action_kind == e.DELETED: 221 # XXX: should drop edir if empty 222 pass 223 210 224 self.__setLastUpstreamRevision(root, changeset.revision) 211 225 226 212 227 ## SyncronizableTargetWorkingDir 213 228 … … 238 253 239 254 # update cvsps cache and get its last CVS "revision" 255 256 # XXX: this is wrong, as it assumes we extracted HEAD! 257 240 258 wdir = join(basedir, module) 241 259 csets = self._getUpstreamChangesets(wdir)
Note: See TracChangeset
for help on using the changeset viewer.
