Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XS8] disktool: Optionally dump old/new partitions during commit #156

Open
wants to merge 1 commit into
base: release/xs8
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions disktools.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,8 @@ def items(self):
yield number, partition

def commit(self, dryrun=False, log=False):
if log:
self.dump()
self.writePartitionTable(dryrun, log)
if not dryrun:
# Update the revert point so this tool can be used repeatedly
Expand All @@ -717,12 +719,12 @@ def dump(self):
for number, partition in sorted(self.origPartitions.items()):
output += "Old partition "+str(number)+":"
for k, v in sorted(partition.items()):
output += ' '+k+'='+((k == 'id') and hex(v) or str(v))
output += ' '+k+'='+((k == 'id' and type(v) == int) and hex(v) or str(v))
output += "\n"
for number, partition in sorted(self.partitions.items()):
output += "New partition "+str(number)+":"
for k, v in sorted(partition.items()):
output += ' '+k+'='+((k == 'id') and hex(v) or str(v))
output += ' '+k+'='+((k == 'id' and type(v) == int) and hex(v) or str(v))
output += "\n"
logger.log(output)

Expand Down