You could use the script I wrote, ac2git, to convert your repo to git but it might take a while.
After the conversion you could use the git filter-branch --subdirectory-filter
to separate the converted monolith git repo into per project git repos.
It should work but it will probably be slow.
Alternatively, if you're up for it, you could modify my script to do what you want. You would just need to make sure that it runs the accurev pop
command only on the directories that you're interested in while it is converting the repo which would make it quicker per project but the same speed over all.
Edit:
If you decide that you want to only convert a single folder at a time it would be trivial for you to hard code the script to do what you want. All you need to do is modify all the calls to accurev.pop()
(of which there is only one in the AccuRev2Git.TryPop()
function) and add another argument to the call specifying which folder you wish to populate.
def TryPop(self, streamName, transaction, overwrite=False):
for i in xrange(0, AccuRev2Git.commandFailureRetryCount):
# --- Remove this line --- #
#popResult = accurev.pop(verSpec=streamName, location=self.gitRepo.path, isRecursive=True, isOverride=overwrite, timeSpec=transaction.id, elementList='.')
# --- And add this instead --- #
popResult = accurev.pop(verSpec=streamName, location=self.gitRepo.path, isRecursive=True, isOverride=overwrite, timeSpec=transaction.id, elementList='/./<your project folder>')
# --- End hardcoding hack --- #
if popResult:
break
else:
self.config.logger.error("accurev pop failed:")
for message in popResult.messages:
if message.error is not None and message.error:
self.config.logger.error(" {0}".format(message.text))
else:
self.config.logger.info(" {0}".format(message.text))
return popResult