开发者

SVN externals - is there something between floating and pinned externals?

开发者 https://www.devze.com 2023-01-14 21:58 出处:网络
I know that people recommend that externals should always point to tags or be pinned to specific revisions (or both for the belts-and-braces brigade!).开发者_开发技巧 I\'m comfortable with this approa

I know that people recommend that externals should always point to tags or be pinned to specific revisions (or both for the belts-and-braces brigade!).开发者_开发技巧 I'm comfortable with this approach when the external points to a unchanging or slowly changing dependency. However, sometimes I need to take an external on a rapidly changing dependency and then it is less effort (though riskier) to set the external to point to the trunk of the dependency.

What I would really like is an intermediate feature which I'm going to call a "tracking external". They way it should work is as follows:

a) If I checkout head, I get head of the external

b) If I check out revision X, I get revision X of the external

This would allow me to always recreate old revisions but also allow me to be exposed to the latest changes of the dependency.

This feature does not seem to exist in SVN, but it seems like an obvious feature to implement. Does anyone know if this feature exists or is planned, or if it can be emulated through some SVN trickery?

Thanks Akash


I think what your asking isn't the correct use of externals. You're doing it wrong.

Externals pull in code from...somewhere else. That 'somewhere else' could be a different location in your current repository, or it could be a different repository on your machine, or a repository hosted on a machine on the other side of the world...

Outside of some special situation where you keep your repository and the external(s) in revision-lockstep (which you could do if your externals are being pulled from a different location in the same repository,) wanting to checkout revision X of your repository along with same revision X in the external repository(ies) is going to end in failure.

How are can you ensure that the main repositories revisions stay in sync with the external repositories revisions? What is supposed to happen when your repository is at revision 1000, and the external'd repository is only at revision 300?

To actually take a stab at answering your question: I've no idea if anything like this is planned for future versions of SVN, but I would bet not. As far as 'trickery', you could perhaps accomplish this by creating some sort of wrapper-script that could modify the external properties to pin them at the revision your planning on checking out BEFORE you actually check out. Not something I would consider practical, nor entirely trivial.


If you just use a branch in an external without specifying a particular revision than this external is floating which means every time you update it you will get the head of that branch...You can do the same in using the trunk. But before you going to release you have to pin that external to a particular state, best practice is to use a tag for this.

0

精彩评论

暂无评论...
验证码 换一张
取 消