diff --git a/README.md b/README.md index 1ae15cb..1bb69b4 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,11 @@ A tool made for migrating code from an existing [RTC] (https://jazz.net/products It uses the CLI of RTC to gather the required information. ## Prerequirements -- RTC Server with Version 5.0+ (Was tested using 5.0.1) -- **[SCM Tools](https://jazz.net/downloads/rational-team-concert/releases/5.0.1?p=allDownloads)** from IBM. To avoid an account creation on jazz.net site, you could use [bugmenot](http://bugmenot.com/) (see also wiki page [configure RTC CLI] (https://github.com/rtcTo/rtc2git/wiki/configure-RTC-CLI)) +- RTC Server with Version 5.0+ (was tested using 5.0.1) +- **[SCM Tools](https://jazz.net/downloads/rational-team-concert/releases/5.0.1?p=allDownloads)** from IBM. + To avoid an account creation on the jazz.net site, you could use [bugmenot](http://bugmenot.com/). + Please make sure that your SCM Tools run in **English** (because we need to parse their output sometimes). + There is a wiki page on how to [configure RTC CLI] (https://github.com/rtcTo/rtc2git/wiki/configure-RTC-CLI)) - Python 3.4+ (does not work with previous versions or with Python 2) ## Usage diff --git a/gitFunctions.py b/gitFunctions.py index 5d0160a..215206e 100644 --- a/gitFunctions.py +++ b/gitFunctions.py @@ -68,8 +68,8 @@ def createrepo(self): @staticmethod def setgitconfigs(): shell.execute("git config push.default current") - shell.execute("git config core.ignorecase false") - shouter.shout("Set core.ignorecase to false") + shell.execute("git config core.ignoreCase false") # should be the default anyway + shouter.shout("Set core.ignoreCase to false") @staticmethod def initialcommit(): diff --git a/rtcFunctions.py b/rtcFunctions.py index 4a387bb..63cb2f0 100644 --- a/rtcFunctions.py +++ b/rtcFunctions.py @@ -111,7 +111,7 @@ def accept(logpath, *changeentries): shouter.shout("Accepting: " + changeEntry.tostring()) revisions = Changes._collectids(changeentries) config = configuration.get() - Changes.latest_accept_command = config.scmcommand + " accept -v -o -r " + config.repo + " -t " + \ + Changes.latest_accept_command = config.scmcommand + " accept --verbose --overwrite-uncommitted --accept-missing-changesets --no-merge --repository-uri " + config.repo + " --target " + \ config.workspace + " --changes" + revisions exitcode = shell.execute(Changes.latest_accept_command, logpath, "a") if exitcode is 0: @@ -213,7 +213,7 @@ def acceptchangesintoworkspace(self, changeentries): if not changeEntry.isAccepted(): # change could already be accepted from a retry if not Changes.accept(self.acceptlogpath, changeEntry): shouter.shout("Change wasnt succesfully accepted into workspace") - self.retryacceptincludingnextchangesets(changeEntry, changeentries) + # self.retryacceptincludingnextchangesets(changeEntry, changeentries) if not Differ.has_diff(): # no differences found - force reload of the workspace WorkspaceHandler().load() @@ -248,8 +248,9 @@ def retryacceptincludingnextchangesets(self, change, changes): if Changes.accept(self.acceptlogpath, *toaccept): issuccessful = True break - else: - Changes.discard(*toaccept) # revert initial state + # ++++ check ++++ + #else: + # Changes.discard(*toaccept) # revert initial state if not issuccessful: self.is_user_aborting(change) diff --git a/tests/test_rtcFunctions.py b/tests/test_rtcFunctions.py index 21d1a5e..36ae2a0 100644 --- a/tests/test_rtcFunctions.py +++ b/tests/test_rtcFunctions.py @@ -25,8 +25,8 @@ def test_Accept_AssertThatCorrectParamaterGetPassedToShell(self, shell_mock): config = self.configBuilder.setrepourl(anyurl).setworkspace(self.workspace).build() configuration.config = config Changes.accept(self.apath, testhelper.createchangeentry(revision1), testhelper.createchangeentry(revision2)) - expected_accept_command = "lscm accept -v -o -r %s -t %s --changes %s %s" % (anyurl, self.workspace, revision1, - revision2) + commandtemplate = u"lscm accept --verbose --overwrite-uncommitted --accept-missing-changesets --no-merge --repository-uri {0:s} --target {1:s} --changes {2:s} {3:s}" + expected_accept_command = commandtemplate.format(anyurl, self.workspace, revision1, revision2) appendlogfileshortcut = "a" shell_mock.execute.assert_called_once_with(expected_accept_command, self.apath, appendlogfileshortcut) self.assertEqual(expected_accept_command, Changes.latest_accept_command) @@ -125,7 +125,7 @@ def test_RetryAccept_AssertThatTwoChangesGetAcceptedTogether(self, inputmock, sh handler = ImportHandler() handler.retryacceptincludingnextchangesets(changeentry1, changeentries) - expectedshellcommand = 'lscm accept -v -o -r anyurl -t anyWs --changes anyRevId anyOtherRevId' + expectedshellcommand = 'lscm accept --verbose --overwrite-uncommitted --accept-missing-changesets --no-merge --repository-uri anyurl --target anyWs --changes anyRevId anyOtherRevId' shellmock.execute.assert_called_once_with(expectedshellcommand, handler.config.getlogpath("accept.txt"), "a") @patch('rtcFunctions.shell') @@ -146,7 +146,7 @@ def test_RetryAccept_AssertThatOnlyChangesFromSameComponentGetAcceptedTogether(s handler = ImportHandler() handler.retryacceptincludingnextchangesets(changeentry1, changeentries) - expectedshellcommand = 'lscm accept -v -o -r anyurl -t anyWs --changes anyRevId anyOtherRevId' + expectedshellcommand = 'lscm accept --verbose --overwrite-uncommitted --accept-missing-changesets --no-merge --repository-uri anyurl --target anyWs --changes anyRevId anyOtherRevId' shellmock.execute.assert_called_once_with(expectedshellcommand, handler.config.getlogpath("accept.txt"), "a") @patch('rtcFunctions.shell')