Skip to content
Snippets Groups Projects
Commit ff291a5e3670 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

track_commit: only rollback if something was committed

parent e0bc03ed6c39
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@
# Do the commits N time
for i in range(10):
needrollback = False
try:
if mode == 'update':
with open(filename, 'a') as target:
......@@ -66,7 +67,8 @@
before = time.time()
self.hg('commit', '-m', 'My commit message',
'-u', '<test@octobus.net>')
needrollback = True
after = time.time()
timings.append(after - before)
finally:
# Rollback and clean
......@@ -69,8 +71,9 @@
after = time.time()
timings.append(after - before)
finally:
# Rollback and clean
self.hg('rollback', '--config', 'ui.rollback=true')
if needrollback:
self.hg('rollback', '--config', 'ui.rollback=true')
self.hg('debugupdatecache')
self.hg('update', '-C', '.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment