Changeset View
Changeset View
Standalone View
Standalone View
swh/vault/cookers/revision_gitfast.py
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | def fastexport(self): | ||||
last_progress_report = None | last_progress_report = None | ||||
for i, rev in enumerate(self.log, 1): | for i, rev in enumerate(self.log, 1): | ||||
# Update progress if needed | # Update progress if needed | ||||
ct = time.time() | ct = time.time() | ||||
if last_progress_report is None or last_progress_report + 2 <= ct: | if last_progress_report is None or last_progress_report + 2 <= ct: | ||||
last_progress_report = ct | last_progress_report = ct | ||||
pg = "Computing revision {}/{}".format(i, len(self.log)) | pg = "Computing revision {}/{}".format(i, len(self.log)) | ||||
self.backend.set_progress(self.obj_type, self.obj_id, pg) | self.backend.set_progress(self.bundle_type, self.obj_id, pg) | ||||
# Compute the current commit | # Compute the current commit | ||||
self._compute_commit_command(rev) | self._compute_commit_command(rev) | ||||
def mark(self, obj_id): | def mark(self, obj_id): | ||||
"""Get the mark ID as bytes of a git object. | """Get the mark ID as bytes of a git object. | ||||
If the object has not yet been marked, assign a new ID and add it to | If the object has not yet been marked, assign a new ID and add it to | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |