Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Lint Skipped |
Unit Tests Skipped |
import weakref | import weakref | ||||
from mercurial.i18n import _ | from mercurial.i18n import _ | ||||
from mercurial import ( | from mercurial import ( | ||||
bookmarks, | bookmarks, | ||||
cmdutil, | cmdutil, | ||||
dispatch, | dispatch, | ||||
encoding, | |||||
error, | error, | ||||
extensions, | extensions, | ||||
hg, | hg, | ||||
localrepo, | localrepo, | ||||
lock, | lock, | ||||
logcmdutil, | logcmdutil, | ||||
node, | node, | ||||
pycompat, | pycompat, | ||||
timestamp, tz = time.split() | timestamp, tz = time.split() | ||||
timestamp, tz = float(timestamp), int(tz) | timestamp, tz = float(timestamp), int(tz) | ||||
oldhashes = tuple(node.bin(hash) for hash in oldhashes.split(',')) | oldhashes = tuple(node.bin(hash) for hash in oldhashes.split(',')) | ||||
newhashes = tuple(node.bin(hash) for hash in newhashes.split(',')) | newhashes = tuple(node.bin(hash) for hash in newhashes.split(',')) | ||||
return cls( | return cls( | ||||
(timestamp, tz), user, command, namespace, name, | (timestamp, tz), user, command, namespace, name, | ||||
oldhashes, newhashes) | oldhashes, newhashes) | ||||
def __str__(self): | def __bytes__(self): | ||||
"""String representation for storage""" | """bytes representation for storage""" | ||||
time = ' '.join(map(str, self.timestamp)) | time = ' '.join(map(str, self.timestamp)) | ||||
oldhashes = ','.join([node.hex(hash) for hash in self.oldhashes]) | oldhashes = ','.join([node.hex(hash) for hash in self.oldhashes]) | ||||
newhashes = ','.join([node.hex(hash) for hash in self.newhashes]) | newhashes = ','.join([node.hex(hash) for hash in self.newhashes]) | ||||
return '\n'.join(( | return '\n'.join(( | ||||
time, self.user, self.command, self.namespace, self.name, | time, self.user, self.command, self.namespace, self.name, | ||||
oldhashes, newhashes)) | oldhashes, newhashes)) | ||||
__str__ = encoding.strmethod(__bytes__) | |||||
class journalstorage(object): | class journalstorage(object): | ||||
"""Storage for journal entries | """Storage for journal entries | ||||
Entries are divided over two files; one with entries that pertain to the | Entries are divided over two files; one with entries that pertain to the | ||||
local working copy *only*, and one with entries that are shared across | local working copy *only*, and one with entries that are shared across | ||||
multiple working copies when shared using the share extension. | multiple working copies when shared using the share extension. | ||||
Entries are stored with NUL bytes as separators. See the journalentry | Entries are stored with NUL bytes as separators. See the journalentry |