-
Notifications
You must be signed in to change notification settings - Fork 69
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
Peru/SVN: Can not import files from a repo-path that existed in the past but has been moved #209
Comments
Perhaps using the imports:
txtTest: common
svn module txtTest:
rev: 32
url: https://<someRepoPath>
pick: dir1_bornRev32 Does that work? |
Or alternatively an |
Also if you want to see exactly what svn command peru is running on your behalf, take a look at this line: https://github.com/buildinspace/peru/blob/master/peru/resources/plugins/svn/svn_plugin.py#L44-L45 You might be able to try running the same command by hand, to see if it behaves the way you expect it to. |
Thank you both for your replies, Sean and Jack. Sean: Yes, in my specific example, it does work with pick, because the rest of the path in "someRepoPath" is still valid in the head-revision. But I see the issue somewhere else. I take it, that the primary goal is the reproducibility of source/builds and I did not get, that either pick or export are required in order to make the source reproducible, I rather understood them as something like filters. Jack: I checked the parameters that peru passes to svn. Hope I did not get it wrong, I don't have any python experience, nor did I use svn from the command line before. I guess it is crucial, to pass this peg revision, which shall be the same as the module revision in order to enable SVN to export from the specified path, that might not exist in the head revision anymore (I guess this is what it defaults to, if not specified). Here is more information about it: Currently, peru passes the following parameters (I use the example from before): Here is a proposal that fixed the issue in my attempts: Please pay attention to the @32 appended to the url (no spaces between url and peg revision). When the optional peg revision is added like this, it works and the files can be retrieved from the path that existed for this specific revision. |
Fascinating! Thanks for figuring this out. I suppose this raises a tricky question. On the one hand, peru could make the simplifying assumption that when you specify It's not immediately obvious to me which of those behaviors is better. I think the documentation you linked to has some important context here. SVN's treatment of paths is more complex than I realized. Apparently if you ask for "directory Thoughts? |
Wow, thanks for finding this! I think I encountered something like this years ago, but it's been ages and I remember very little about using Subversion.
My gut reaction is that peru should not map the If we decide not to be opinionated and roll with Subversion, then we'll probably want to briefly document support for peg revisions in the |
I also did not imagine it being this complex. Here are my thoughts on this: I tried to get a better understanding for the use of operative and peg revisions (reading the article referenced before https://edoras.sdsu.edu/doc/svn-book-html-chunk/svn.advanced.pegrevs.html) and forgot about "peru reup" for now, to not burden the mind with possible consequences. To my understanding, in order to make a snapshot of a project, the operative and peg revision should be identical. If both versions match, there is no room for interpretation of what components / revisions to use. Also the referenced path/url should represent the current path of when the snapshot was made. Here's just a first thought:
If I did not get it wrong, there might be already a minor latent issue here: I would recommend to append an at character to the url anyway, because svn will always try to interpret the last at character in the url as the peg revision, even if it is part of the actual url/path name. Appending an at character to the path should fix the danger of a path containing at characters unintentionally being interpreted as a peg revision, because only the very last at character is used for this (this is also well explained in the referenced article). Currently it matters a lot what the operative / peg revision defaults to. If the peru.yaml should be considered as a tag (I assume svn and git tags basically work in a similar way), the default value of the peg revision is not suitable in my opinion (according to the article it defaults to BASE) - at least not, when a We are not the first to worry about this svn pitfall. Apparently there have been changes to the format / order of parameters in svn that led to this pitfall. The beginning of this thread on stackoverflow is quite interesting and points out the dangers that emerged with the "new" format: Still not worrying about the implications it might have on "peru reup", my proposal would go in this direction:
These are at least my thought's on this (sorry for the long comment). |
(Apologies for leaving this hanging for a while. I'm still leaning towards keeping the current behavior, but I want to think more carefully about this and maybe play around with both before we make a final call, and I might not find time to do that soon.) |
Hi,
I just started using peru (Version V1.2.0, Windows 10) and did various tests in order to get some experiences with it.
For the time being, I use SVN only (I am not familiar with git).
The issue I experienced is, that I can not import files from svn repository paths, that have been moved to a different location within the same repository and do not exist in the head revision.
I explicitly specify the corresponding revision of when the path still existed in the past.
The corresponding peru.yaml file looks like this:
someRepoPath is obviously just a place holder. The sub directory dir1_bornRev32 exists in Revision 32 at the specified location, but it does not exist in the head (latest) revision, because it has been moved elsewhere.
However, if I start peru,
peru sync
the operation can not be completed successfully. Peru passes the following error message to the command shell:
svn: E160013: '<someRepoPath>/!svn/rvr/35/trunk/dir1_bornRev32' path not found
What meets the eye, is that the Revision that is passed back is not the one explicitly specified (32), but the head revision (35). So the information in the error message is correct: that path does not exist in revision 35 (head).
I assume that at some point the specified revision is not explicitly passed to SVN.
It would be great, if you could try to reproduce the issue. My colleague was able to reproduce the issue (with the same repository).
Thank you in advance.
Best Regards,
Tweakbert
The text was updated successfully, but these errors were encountered: