From bd0f23dc71b6878fe6542d4a40382e06a53da473 Mon Sep 17 00:00:00 2001 From: ljhaywar Date: Fri, 8 May 2015 12:21:19 -0400 Subject: [PATCH] Fix Issue 14 https://github.com/WtfJoke/rtc2git/issues/14 The script was throwing errors like "No repositories found based on path. Specify repository URI." and "Problem running 'discard': Unable to find workspace. Specify workspace." --- rtcFunctions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rtcFunctions.py b/rtcFunctions.py index 6aae08c..6cae0b2 100644 --- a/rtcFunctions.py +++ b/rtcFunctions.py @@ -78,6 +78,7 @@ def recreateoldestworkspace(self): class Changes: + latest_accept_command = "" @staticmethod @@ -86,11 +87,11 @@ def discard(*changeentries): shell.execute("lscm discard --overwrite-uncommitted " + idstodiscard) @staticmethod - def accept(*changeentries, logpath): + def accept(*changeentries, workspace, repo, logpath): for changeEntry in changeentries: shouter.shout("Accepting: " + changeEntry.tostring()) revisions = Changes._collectids(changeentries) - latest_accept_command = "lscm accept -v --overwrite-uncommitted --changes " + revisions + latest_accept_command = "lscm accept -v --overwrite-uncommitted --changes " + revisions + " --target " + workspace + " -r " + repo return shell.execute(latest_accept_command, logpath, "a") @staticmethod @@ -155,7 +156,7 @@ def acceptchangesintoworkspace(self, changeentries): if skipnextchangeset: skipnextchangeset = False continue - acceptedsuccesfully = Changes.accept(changeEntry, logpath=self.acceptlogpath) is 0 + acceptedsuccesfully = Changes.accept(changeEntry, workspace=self.config.workspace, repo=self.config.repo, logpath=self.acceptlogpath) is 0 if not acceptedsuccesfully: shouter.shout("Change wasnt succesfully accepted into workspace") skipnextchangeset = self.retryacceptincludingnextchangeset(changeEntry, changeentries) @@ -179,7 +180,7 @@ def retryacceptincludingnextchangeset(self, change, changes): " changeset and continue"): return False Changes.discard(change) - successfull = Changes.accept(change, nextchangeentry, logpath=self.acceptlogpath) is 0 + successfull = Changes.accept(change, nextchangeentry, workspace=self.config.workspace, repo=self.config.repo, logpath=self.acceptlogpath) is 0 if not successfull: Changes.discard(change, nextchangeentry)