Mercurial > hgsubversion
comparison hg_delta_editor.py @ 237:c90cfa665b81
Cope with date-less revisions.
| author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
|---|---|
| date | Wed, 08 Apr 2009 13:07:23 +0200 |
| parents | c0063328587f |
| children | 79349fd04836 |
comparison
equal
deleted
inserted
replaced
| 236:c34abd2448b7 | 237:c90cfa665b81 |
|---|---|
| 127 self.readauthors(self.authors_file) | 127 self.readauthors(self.authors_file) |
| 128 if authors and os.path.exists(authors): | 128 if authors and os.path.exists(authors): |
| 129 self.readauthors(authors) | 129 self.readauthors(authors) |
| 130 if self.authors: | 130 if self.authors: |
| 131 self.writeauthors() | 131 self.writeauthors() |
| 132 | |
| 133 self.lastdate = '1970-01-01 00:00:00' | |
| 132 self.includepaths = {} | 134 self.includepaths = {} |
| 133 self.excludepaths = {} | 135 self.excludepaths = {} |
| 134 if filemap and os.path.exists(filemap): | 136 if filemap and os.path.exists(filemap): |
| 135 self.readfilemap(filemap) | 137 self.readfilemap(filemap) |
| 138 | |
| 139 def fixdate(self, date): | |
| 140 if date is not None: | |
| 141 date = date.replace('T', ' ').replace('Z', '').split('.')[0] | |
| 142 date += ' -0000' | |
| 143 self.lastdate = date | |
| 144 else: | |
| 145 date = self.lastdate | |
| 146 return date | |
| 136 | 147 |
| 137 def __setup_repo(self, repo_path): | 148 def __setup_repo(self, repo_path): |
| 138 """Verify the repo is going to work out for us. | 149 """Verify the repo is going to work out for us. |
| 139 | 150 |
| 140 This method will fail an assertion if the repo exists but doesn't have | 151 This method will fail an assertion if the repo exists but doesn't have |
| 571 # back to a list and sort so we get sane behavior | 582 # back to a list and sort so we get sane behavior |
| 572 files_to_commit = list(files_to_commit) | 583 files_to_commit = list(files_to_commit) |
| 573 files_to_commit.sort() | 584 files_to_commit.sort() |
| 574 branch_batches = {} | 585 branch_batches = {} |
| 575 rev = self.current_rev | 586 rev = self.current_rev |
| 576 date = rev.date.replace('T', ' ').replace('Z', '').split('.')[0] | 587 date = self.fixdate(rev.date) |
| 577 date += ' -0000' | |
| 578 | 588 |
| 579 # build up the branches that have files on them | 589 # build up the branches that have files on them |
| 580 for f in files_to_commit: | 590 for f in files_to_commit: |
| 581 if not self._is_path_valid(f): | 591 if not self._is_path_valid(f): |
| 582 continue | 592 continue |
