Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try and infer the source stream when it is unavailable #60

Closed
orao opened this issue Apr 3, 2016 · 7 comments
Closed

Try and infer the source stream when it is unavailable #60

orao opened this issue Apr 3, 2016 · 7 comments

Comments

@orao
Copy link
Collaborator

orao commented Apr 3, 2016

For depots on old versions of Accurev or depots that have undergone an update/upgrade from old versions of Accurev there will be transactions for which the fromStreamName and fromStreamNumber attributes of the <transaction /> element in the XML output of the accurev hist command is missing. This means that we can't perform a merge for a promote in these cases.

It should be possible to try and infer, in a naive way, if the transaction came from one of the child streams of the stream on which the promote occurred.

If we find a child stream that was different from this stream (its basis stream) at the previous transaction (whatever it may be) and that at this transaction it becomes the same then it is extremely likely that the promote came from that stream.

Even if we are processing only a subset of streams this naive algorithm should work pretty well, even in the cases where the promote came via an untracked intermediate stream.

@orao
Copy link
Collaborator Author

orao commented Apr 11, 2016

This would be solved by solving issue #51.

@orao orao modified the milestones: Version 0.5, Version 0.6 Apr 11, 2016
@ghost ghost modified the milestones: Future, Version 0.6 Sep 7, 2016
@orao orao modified the milestones: v0.7, Future Sep 16, 2016
@ghost
Copy link

ghost commented Dec 14, 2016

These are the assumptions which should apply to the inferred source stream:

  1. The source stream was not changed by this transaction.
    1.1. The source stream therefore cannot be timelocked.
  2. The destination stream was changed by this transaction.
  3. The destination stream's contents is exactly the same as the source stream's contents at this transaction.

If these assumptions hold for a child stream and a basis stream where the child stream is assumed to be the source stream and the basis stream is assumed to be the destination stream then we can find the most likely source stream.

If any of these are untrue we reduce the likelihood and should probably not continue.

@fatfreddie
Copy link
Collaborator

Good insight about source stream not changing but not sure the conclusion is valid. I'm pretty sure it is possible to promote from a time-locked child stream into a parent stream.

ghost pushed a commit that referenced this issue Dec 14, 2016
Implemented new algorithm to infer the source stream of an Accurev
promote transaction. This is done when this information is not available
in the `accurev hist -fevx` output, which is the case for Accurev
transactions recorded with old versions of accurev and affects depots
which have gone through several upgrades.

This new algorithm is experimental and is controlled via flags which
default to being disabled and clearly state that it is an experimental
feature.
@ghost
Copy link

ghost commented Dec 14, 2016

That is correct and it won't be handled by the algorithm, which leaves us in the same position w.r.t. time locked streams but improves the situation for non-timelocked streams.

@ghost
Copy link

ghost commented Dec 14, 2016

Without recreating and tracking stream default sets there is little chance of having a perfect solution.

@fatfreddie
Copy link
Collaborator

Now there's a thought ... but no that's way too expensive for the benefit.

@ghost ghost closed this as completed Dec 15, 2016
@ghost
Copy link

ghost commented Dec 15, 2016

Though this is a limited use case it is one of the more common ones, hence this solution, provided it is implemented correctly should be useful.

ghost pushed a commit that referenced this issue Dec 15, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants