Closed marcnorthover closed 8 years ago
I'm not familiar enough with the code but it seems to me there are two possible resolutions. Either run accurev hist -fx -t 10063
, or search the output for transaction 10063. I am assuming that transaction 10063 is being processed at this point.
I wonder how the code determines that a transaction range is needed, and if it can be modified to use only one (correct) transaction in this case.
You could replace this if statement with a check that looks at the result of the accurev show streams
command before and after the found mkstream
transaction and if it is determined that our stream has been created here then we return that transaction.
I chose not to do that because it was much, much slower.
Replace this code with the following:
mkstreamTrList = []
for t in mkstreams.transactions:
if GetTimestamp(t.time) == GetTimestamp(streamInfo.startTime):
mkstreamTrList.append(t)
elif GetTimestamp(t.time) < GetTimestamp(streamInfo.startTime):
break # There's no point in looking for it any further than this since the transactions are sorted in descending order of transaction number and hence by time as well.
if len(mkstreamTrList) == 1:
mkstreamTr = mkstreamTrList[0]
elif len(mkstreamTrList) > 1:
# You're really, really unlucky here.
for t in mkstreamTrList:
before = show.streams(depot=depot, timeSpec=(t.id - 1)).getStream(streamInfo.streamNumber)
after = show.streams(depot=depot, timeSpec=(t.id)).getStream(streamInfo.streamNumber)
if before is None and after is not None:
mkstreamTr = t
break
Which should fix it...
If that patch does fix it (and you've tested it does what is expected) please commit it & supply it back so I can merge it in.
The fix seems to work just fine. I created a fork and a branch with the patch and merged it back to the master. Let me know if anything else is required.
Though I wanted you to make a pull request from your fork to our upstream it doesn't matter in the end since GitHub allows me to make pull requests from any fork. This is what I've done and I've incorporated your changes in our master branch.
Thanks for supplying the patch! I hope that this makes up for me stealing that other issue from under you... Your name should now be in the contributors list.
I received this error:
Sure enough in accurev I have 2 transactions from 2 separate projects with the same timestamp:
Any suggestions on a fix for this one? If there are more than 1, seems like we can for loop thru and find the one that matches the given stream name?