Skip to content

Commit

Permalink
resuming the migration without changing config.ini is now possible fo…
Browse files Browse the repository at this point in the history
…r simple streams
  • Loading branch information
ohumbel committed Aug 19, 2015
1 parent 5abe83d commit 0a750ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
27 changes: 16 additions & 11 deletions migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def migrate():
rtcworkspace = WorkspaceHandler()
git = Commiter

resumed = False
if existsrepo():
resumed = True
resume()
else:
initialize()
Expand All @@ -65,23 +67,26 @@ def migrate():

componentbaselineentries = rtc.getcomponentbaselineentriesfromstream(streamuuid)
rtcworkspace.setnewflowtargets(streamuuid)
git.branch(branchname)

history = rtc.readhistory(componentbaselineentries, streamname)
changeentries = rtc.getchangeentriesofstreamcomponents(componentbaselineentries)

rtc.acceptchangesintoworkspace(rtc.getchangeentriestoaccept(changeentries, history))
shouter.shout("All changes until creation of stream '%s' accepted" % streamname)
git.pushbranch(branchname)
git.branch(streamname)
if not resumed:
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)

rtcworkspace.setcomponentstobaseline(componentbaselineentries, streamuuid)
rtcworkspace.load()
rtcworkspace.setcomponentstobaseline(componentbaselineentries, streamuuid)
rtcworkspace.load()

git.branch(streamname)
changeentries = rtc.getchangeentriesofstream(streamuuid)
rtc.acceptchangesintoworkspace(rtc.getchangeentriestoaccept(changeentries, history))
git.pushbranch(streamname)
git.promotebranchtomaster(streamname)
amountofacceptedchanges = rtc.acceptchangesintoworkspace(rtc.getchangeentriestoaccept(changeentries, history))
if not resumed or amountofacceptedchanges > 0:
git.pushbranch(streamname)
git.promotebranchtomaster(streamname)

RTCLogin.logout()
shouter.shout("\nAll changes accepted - Migration of stream '%s' is completed. \n"
"You should adjust your .gitignore to ignore the same files as defined in your .jazzignore \n"
Expand Down
1 change: 1 addition & 0 deletions rtcFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def acceptchangesintoworkspace(self, changeentries):
reloaded = True
shouter.shout("Accepted change %s/%s into working directory" % (amountofacceptedchanges, amountofchanges))
Commiter.addandcommit(changeEntry)
return amountofacceptedchanges

@staticmethod
def collect_changes_to_accept_to_avoid_conflicts(changewhichcantacceptedallone, changes):
Expand Down

0 comments on commit 0a750ff

Please sign in to comment.