简体   繁体   中英

Getting Revisions ONLY in my directory and not in root Repository

Ok, this is a little difficult to explain so bear with me.

Let's say for example I have this repository I'm working out of path/to/repos/users

In this repository there is a bunch of different users for example.

*../../../users/me

../../../users/you*

And we're both making commits in TortoiseSVN like usual and for this example let's say revision 10 is the head revision. In the "../me" directory I've only submitted 10, 6, and 5. And the "../you" directory committed everything else.

If I were to use a svn command in that directory = svn update -r PREV and I were to check the version number using svnversion the number I would get is 9. However, I don't want 9. Which brings me to my question, is there any way using the command line to update to previous revisions and get revisions that only "../me" submitted?

Sorry if it is a little hard to understand, if there's anything I can provide to make it a bit clearer just let me know. Thank you.

I figured out my issue this morning, to answer my own question, when working with subfolders out of a checked out repository, every time a svn update -r PREV command is called, it updates to the previous revisions in me directory. However, running svnversion on at that point will give you the previous revision in ../../repos/users to solve this issue, I called svn info . in the me directory and noted that the Last Changed Rev: had the number that I needed. To get this I called svn info (this is in php btw):

exec('svn info .', $info);

Then I used a regular expression to grab the key:

$versionKey = array_keys(preg_grep('/Last Changed Rev/', $info));

And then set the version to that revision number using substr with an offset of 18:

$version = substr($info[$versionKey[0]], 18);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM