From b568a246f5b4f153a2bcad10043e7b7d0797c74a Mon Sep 17 00:00:00 2001 From: Otmar Humbel Date: Wed, 26 Aug 2015 11:21:03 +0200 Subject: [PATCH] make sure no changsets are missed on restart --- migration.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/migration.py b/migration.py index 4067123..1fc030f 100644 --- a/migration.py +++ b/migration.py @@ -53,9 +53,7 @@ def migrate(): rtcworkspace = WorkspaceHandler() git = Commiter - resumed = False if existsrepo(): - resumed = True resume() else: initialize() @@ -69,10 +67,10 @@ def migrate(): rtcworkspace.setnewflowtargets(streamuuid) history = rtc.readhistory(componentbaselineentries, streamname) + changeentries = rtc.getchangeentriesofstreamcomponents(componentbaselineentries) - if not resumed: + if len(changeentries) > 0: git.branch(branchname) - changeentries = rtc.getchangeentriesofstreamcomponents(componentbaselineentries) rtc.acceptchangesintoworkspace(rtc.getchangeentriestoaccept(changeentries, history)) shouter.shout("All changes until creation of stream '%s' accepted" % streamname) git.pushbranch(branchname) @@ -83,7 +81,7 @@ def migrate(): git.branch(streamname) changeentries = rtc.getchangeentriesofstream(streamuuid) amountofacceptedchanges = rtc.acceptchangesintoworkspace(rtc.getchangeentriestoaccept(changeentries, history)) - if not resumed or amountofacceptedchanges > 0: + if amountofacceptedchanges > 0: git.pushbranch(streamname) git.promotebranchtomaster(streamname)