Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHGa274c4b698f2: py3: handle keyword arguments correctly in archival.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| durin42 |
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| '''write archive to tar file or stream. can write uncompressed, | '''write archive to tar file or stream. can write uncompressed, | ||||
| or compress with gzip or bzip2.''' | or compress with gzip or bzip2.''' | ||||
| class GzipFileWithTime(gzip.GzipFile): | class GzipFileWithTime(gzip.GzipFile): | ||||
| def __init__(self, *args, **kw): | def __init__(self, *args, **kw): | ||||
| timestamp = None | timestamp = None | ||||
| if 'timestamp' in kw: | if 'timestamp' in kw: | ||||
| timestamp = kw.pop('timestamp') | timestamp = kw.pop(r'timestamp') | ||||
| if timestamp is None: | if timestamp is None: | ||||
| self.timestamp = time.time() | self.timestamp = time.time() | ||||
| else: | else: | ||||
| self.timestamp = timestamp | self.timestamp = timestamp | ||||
| gzip.GzipFile.__init__(self, *args, **kw) | gzip.GzipFile.__init__(self, *args, **kw) | ||||
| def _write_gzip_header(self): | def _write_gzip_header(self): | ||||
| self.fileobj.write('\037\213') # magic header | self.fileobj.write('\037\213') # magic header | ||||