Skip to content

Commit

Permalink
make sure no changsets are missed on restart
Browse files Browse the repository at this point in the history
  • Loading branch information
ohumbel committed Aug 26, 2015
1 parent 09ebb87 commit b568a24
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ def migrate():
rtcworkspace = WorkspaceHandler()
git = Commiter

resumed = False
if existsrepo():
resumed = True
resume()
else:
initialize()
Expand All @@ -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)
Expand All @@ -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)

Expand Down

0 comments on commit b568a24

Please sign in to comment.