Changeset 465
- Timestamp:
- 05/19/08 09:18:08
(8 months ago)
- Author:
- jmowery
- Message:
syntax fixes
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r464 |
r465 |
|
| 295 | 295 | self.modified = False |
|---|
| 296 | 296 | |
|---|
| 297 | | def rollback(self, date=int(time.time(), name='.', recursive=False): |
|---|
| | 297 | def rollback(self, date=int(time.time()), name='.', recursive=False): |
|---|
| 298 | 298 | '''Roll back (or forward) to date. If name specifies a directory set the applied time of all files it contains to the most recent as of date; else operate only on name.''' |
|---|
| 299 | 299 | raise NotImplementedError |
|---|
| … | … | |
| 485 | 485 | if name_entry.type == 'DIR': |
|---|
| 486 | 486 | st_type = '+' |
|---|
| 487 | | elif name_entry.type == '.' |
|---|
| | 487 | elif name_entry.type == '.': |
|---|
| 488 | 488 | st_type = '-' |
|---|
| 489 | 489 | elif name_entry.type == 'LOCAL': |
|---|
| … | … | |
| 557 | 557 | stats.append(self.status_prefix(names) + prefix + names + self.version_suffix(names)) |
|---|
| 558 | 558 | if recursive and e.type != 'FILE': |
|---|
| 559 | | l = Layer(os.path.join(self.storage.path, names) |
|---|
| | 559 | l = Layer(os.path.join(self.storage.path, names)) |
|---|
| 560 | 560 | stats += l.status('.', recursive) |
|---|
| 561 | 561 | l.update() |
|---|
| … | … | |
| 632 | 632 | def lock(self, names=['.'], recursive=False): |
|---|
| 633 | 633 | '''Lock each file or directory in names preventing modifications other than rollback.''' |
|---|
| | 634 | if not self.stprage: |
|---|
| | 635 | raise RuntimeError, 'Attempt to lock files in uncontroled layer.' |
|---|
| 634 | 636 | raise NotImplementedError |
|---|
| 635 | 637 | |
|---|
| … | … | |
| 640 | 642 | def is_locked(self, name='.', recursive=False): #add recursive as option) |
|---|
| 641 | 643 | '''Return True if name was locked by a prior call to lock(); if recursive, return True if any file under name is locked.''' |
|---|
| 642 | | if not storage: |
|---|
| | 644 | if not self.storage: |
|---|
| 643 | 645 | return False #not controlled, can't be locked |
|---|
| 644 | 646 | e = self.get_entry(name) |
|---|
| … | … | |
| 786 | 788 | return self.layers.keys() |
|---|
| 787 | 789 | |
|---|
| 788 | | def check_updates(self) |
|---|
| | 790 | def check_updates(self): |
|---|
| 789 | 791 | '''Compare the status of all files in each layer to which this node belongs and return a list of those that need to be sent to it.''' |
|---|
| 790 | 792 | raise NotImplementedError |
|---|
| … | … | |
| 796 | 798 | self.modified = False |
|---|
| 797 | 799 | |
|---|
| 798 | | def set_file_status(self, name, layer_path, version, local=True) |
|---|
| | 800 | def set_file_status(self, name, layer_path, version, local=True): |
|---|
| 799 | 801 | '''Record that a new version of module name from layer has been successfully sent to the node system.''' |
|---|
| 800 | 802 | l = Layer(layer_path) |
|---|
| … | … | |
| 808 | 810 | self.entries[name] = Entry(name) |
|---|
| 809 | 811 | self.entries[name].group = l.name |
|---|
| 810 | | if self.entries[name].applied != version |
|---|
| | 812 | if self.entries[name].applied != version: |
|---|
| 811 | 813 | self.entries[name].local = local |
|---|
| 812 | 814 | self.entries[name].applied = version |
|---|
| … | … | |
| 878 | 880 | del self.layers[o] |
|---|
| 879 | 881 | ol = Layer(o) |
|---|
| 880 | | if os.path.exists(os.path.join(ol.storage.nodes_dir, self.id)) |
|---|
| | 882 | if os.path.exists(os.path.join(ol.storage.nodes_dir, self.id)): |
|---|
| 881 | 883 | os.remove(os.path.join(ol.storage.nodes_dir, self.id)) |
|---|
| 882 | 884 | for n in new_dirs: |
|---|
Download in other formats:
* Generating other formats may take time.