Changeset 475
- Timestamp:
- 05/21/08 09:59:49
(8 months ago)
- Author:
- jmowery
- Message:
update to storage after some initial testing
all storage specific functions other than export and locking tested
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r474 |
r475 |
|
| 343 | 343 | now = int(time.time()) |
|---|
| 344 | 344 | layer_latest = 0 |
|---|
| | 345 | for d in self.list_controlled_dirs(): #consider initial time for controlled dirs for latest |
|---|
| | 346 | if self.entries[d].initial > layer_latest: |
|---|
| | 347 | layer_latest = self.entries[d].initial |
|---|
| 345 | 348 | for name in self.list_controlled_files(): #update all latest fields |
|---|
| 346 | 349 | file_latest = self.storage.find_recent(name, now) |
|---|
| … | … | |
| 487 | 490 | _l.checkin() |
|---|
| 488 | 491 | _l.update() |
|---|
| | 492 | self.update() |
|---|
| 489 | 493 | |
|---|
| 490 | 494 | #functions to add and remove files and directories |
|---|
| … | … | |
| 592 | 596 | self.storage = StorageData() |
|---|
| 593 | 597 | self.storage.path = self.name |
|---|
| 594 | | self.storage.root = find_control_root(self.storage.path) |
|---|
| 595 | | self.name = self.name[len(os.path.dirname(self.storage.root)) + 1:] #shorten name removing directories above root |
|---|
| 596 | 598 | self.storage.storage_dir = os.path.join(self.storage.path, '.__storage__') |
|---|
| 597 | 599 | os.mkdir(self.storage.storage_dir) |
|---|
| 598 | 600 | self.storage.nodes_dir = os.path.join(self.storage.path, '.__nodes__') |
|---|
| 599 | 601 | os.mkdir(self.storage.nodes_dir) |
|---|
| 600 | | self.storage.logs_dir = os.path.join(self.storage.root, '.__logs__') |
|---|
| 601 | | if not os.path.exists(self.storage.logs_dir): |
|---|
| 602 | | os.mkdir(self.storage.logs_dir) |
|---|
| 603 | 602 | self.storage.status_path = os.path.join(self.storage.path, '.__status__') |
|---|
| 604 | 603 | if not self.storage.config.has_section('general'): |
|---|
| … | … | |
| 610 | 609 | self.entries['.'] = self.storage.add_dir('.') |
|---|
| 611 | 610 | self.storage.write() |
|---|
| | 611 | self.storage.root = find_control_root(self.storage.path) |
|---|
| | 612 | self.storage.logs_dir = os.path.join(self.storage.root, '.__logs__') |
|---|
| | 613 | if not os.path.exists(self.storage.logs_dir): |
|---|
| | 614 | os.mkdir(self.storage.logs_dir) |
|---|
| | 615 | self.name = self.name[len(os.path.dirname(self.storage.root)) + 1:] #shorten name removing directories above root |
|---|
| | 616 | self.modified = True |
|---|
| 612 | 617 | if is_controlled(os.path.join(self.storage.path, '..')): |
|---|
| 613 | 618 | _l = Layer(os.path.join(self.storage.path, '..')) |
|---|
| 614 | 619 | _l.add(os.path.basename(self.storage.path)) |
|---|
| 615 | 620 | _l.update() |
|---|
| | 621 | self.update() |
|---|
| 616 | 622 | |
|---|
| 617 | 623 | def clean(self, names, recursive=False): |
|---|
| … | … | |
| 747 | 753 | continue |
|---|
| 748 | 754 | stats.append(self.status_prefix(entry) + entry + self.version_suffix(entry)) |
|---|
| | 755 | for d in self.list_controlled_dirs(): |
|---|
| | 756 | _l = Layer(os.path.join(self.storage.path, d)) |
|---|
| | 757 | stats += _l.status('.', recursive) |
|---|
| | 758 | _l.update() |
|---|
| 749 | 759 | return stats |
|---|
| 750 | 760 | e = self.get_entry(names) |
|---|
Download in other formats:
* Generating other formats may take time.