Is it normal that external SVN files are not running?

I am new to Subversion and recently learned how to automatically import files belonging to other repositories using svn:externals . And now, when I commit the trunk folder and create a tag to create a snapshot of the project, the files / folders defined as external will not be added to the tag folder.

For example, I have this folder structure

Z: \ repo \ repoA

Z: \ repo \ repoB

Z: \ Projects \ workB

I installed svn:externals on Z:\Projects\workB in file:///Z:/repos/repoA/trunk/lib trunk/lib , so the repoA lib folder is automatically added to the current working directory, Z:\Projects\workB\trunk . And in fact, when I perform SVN Update , the lib folder is created under the trunk folder.

After editing some files and doing SVN Commit... on Z:\Projects\workB\trunk , I selected TortoiseSVN -> Branch/Tag in the context menu. In the To Path field, enter tags/1.0.1 and click OK. Tag 1.0.1 was successfully created.

After I performed SVN Update on Z:\Projects\workB\tags , a folder with the name 1.0.1 appeared, but without external files.

This is normal? I expected that the imported files will also be there, as they are in the folder with the chest of the working directory.


I created two public repositories in Assembla for those who can verify this.

The second repository has an externals definition that pulls the lib folder from the first repository. When I create a tag for the current trunk files from the second repository, it does not add external files to the tag folder. Also, when I check the tag folder, it will not add external files to the local working copy.

+6
source share
2 answers

When you set the externals property, it does not copy files from the external repository to your working repository. Rather, it simply creates a β€œnote” on where to extract these files in the future.

Thus, when creating a tag, svn does not bother to copy actual files that are linked externally. Instead, it simply copies the β€œnote”. If you checked your tags/1.0.1 directory (or updates if it is already locally checked), you will notice that it correctly pulled out the corresponding external elements, even if these files did not exist in the working repository.

change

Ah, I finally saw the problem. You install external in the root directory, not in the trunk directory.

The best way to view svn is that it is just a file system, the whole idea of ​​a chest, tags and branches is just conceptual ideas, and each directory is no different from the next.

Thus, when copying a trunk to the tag catalog, external properties are not transferred, since they are not part of the trunk catalog (they only talk about the delivery of external elements to the trunk). To solve the problem, you must remove the external properties from the root directory and add them to the trunk. The next time you create the tag, the external properties should be migrated.

Next command:

 svn propget svn:externals file:///Z:/Projects/workB/trunk 

should be displayed:

 file:///Z:/repos/repoA/trunk/lib lib 
+4
source

The expectation is true. svn copy should create a 100% copy of the original object, i.e. external definition (and content) should appear in the tag

  • Check svn ls -v -R file:///Z:/repos/repoB/tags/1.0.1
  • To simplify the verification and the problem, I suggest switching to a public repo set - for testing, you can, fe, create Assembla with two or more SVN repositories in free space

Does not apply to a note to the problem: by convention, a tag is used as a code freeze point (later you can get exactly the same code from any point), but this means that you also have to block all external status elements of the tag. repos / repoA / trunk / lib is a HEAD revision that changes over time and the corresponding revision (link tag rev - lib rev) for the 1.0.1 tag will be lost. Read about PEG versions

Edit

Checked by Assembla repo with extension in the trunk. Verification failed:

 >svn co https://subversion.assembla.com/svn/subversion-troubleshoot-b/trunk . A core_mod.txt Checked out revision 4 

there I also needed to check the / lib folder

Edit2

To reposition subversion-troubleshoot-b: corrections applied to the definition, created correctly written tag ( 1.0.1 ) with external binding to PEG -revision

See differences between trunks and tags validation.

 z:\>svn co https://subversion.assembla.com/svn/subversion-troubleshoot-b/ ... Fetching external item into 'subversion-troubleshoot-b\trunk\lib': A subversion-troubleshoot-b\trunk\lib\lib01.txt Checked out external at revision 4. Fetching external item into 'subversion-troubleshoot-b\tags\1.0.1\lib': A subversion-troubleshoot-b\tags\1.0.1\lib\lib01.txt Checked out external at revision 2. Checked out revision 7. 

if you change the lib in the linked repo later - trunk will get the last contents of the folder, 1.0.1 - will always be with version 2 of lib in disruptive work - troubleshooting

+2
source

Source: https://habr.com/ru/post/927825/


All Articles