Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gitFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
9 changes: 5 additions & 4 deletions rtcFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions tests/test_rtcFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand All @@ -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')
Expand Down