Changeset 962 in tailor
- Timestamp:
- 10/27/05 09:56:59 (8 years ago)
- Hash name:
- 20051027075659-2c016-1b169d8c9c03e1c7f7d8e86057afafcbb916bfa2
- File:
-
- 1 edited
-
vcpx/monotone.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/monotone.py
r961 r962 311 311 self.repository = repository 312 312 313 def _addPathToSet(self, s, dirs): 314 for d in xrange(0,len(dirs)): 315 nd = '/'.join(dirs[0:d]) 316 s.add( nd ); 317 313 318 def convertDiff(self, chset): 314 319 """ … … 337 342 "monotone diff returned status %d" % mtl.exit_status) 338 343 344 implicit_dirs_add = set() 345 dirs_add = set() 346 339 347 # monotone diffs are prefixed by a section containing 340 348 # metainformations about files … … 361 369 362 370 # ok, is a file, control changesets data 363 if token == "add_file" or token=="add_directory":371 if token == "add_file": 364 372 chentry = chset.addEntry(fname[1:-1], chset.revision) 365 373 chentry.action_kind = chentry.ADDED 374 # split filespec in parts, skipping the filename 375 # (monotone always uses '/' as path separator) 376 self._addPathToSet(implicit_dirs_add, "/".split(chentry.name)[:-1]); 377 elif token=="add_directory": 378 chentry = chset.addEntry(fname[1:-1], chset.revision) 379 chentry.action_kind = chentry.ADDED 380 self._addPathToSet(dirs_add, "/".split(chentry.name)); 366 381 elif token == "delete_file" or token=="delete_directory": 367 382 chentry = chset.addEntry(fname[1:-1], chset.revision) … … 378 393 chentry.action_kind = chentry.RENAMED 379 394 chentry.old_name= fname[1:-1] 395 if token=="rename_directory": 396 self._addPathToSet(dirs_add, "/".split(chentry.name)) 380 397 elif token == "patch": 381 398 # patch entries are in the form: from oldrev to newrev … … 401 418 if in_item: 402 419 raise GetUpstreamChangesetsFailure("Unexpected end of 'diff' parsing changeset info") 420 421 # remove explicit dir adds from implicit set, then create "add" changesets 422 # for the remaining dirs 423 implicit_dirs_add = implicit_dirs_add.difference(dirs_add) 424 for d in implicit_dirs_add: 425 chentry = chset.addEntry(d, chset.revision) 426 chentry.action_kind = chentry.ADDED 403 427 404 428
Note: See TracChangeset
for help on using the changeset viewer.
