0

I need to checkout a part of the repo. This is what I do:

rm -rf root_dir
mkdir -p root_dir
svn co --depth empty https://some.repo/branches/branch1 root_dir
svn up --set-depth empty root_dir/level1
svn up --set-depth empty root_dir/level1/level2
svn up --set-depth empty root_dir/level1/level2/level3
svn up --set-depth infinity root_dir/level1/level2/level3/level4

When I do this interactively, everything seems to be okay. But when I paste these same lines into a script and run it, .svn directories get added at every level of the directory hierarchy.

$ svn --version
svn, version 1.9.4 (r1740329)
   compiled May 26 2016, 12:44:27 on x86_64-redhat-linux-gnu

$ rpm -qi subversion
Name        : subversion
Version     : 1.9.4
Release     : 2.fc23
Architecture: x86_64
Install Date: Thu Jan 19 20:35:00 2017
Group       : Development/Tools
Size        : 5245105
License     : ASL 2.0
Signature   : RSA/SHA256, Thu May 26 19:22:58 2016, Key ID 32474cf834ec9cba
Source RPM  : subversion-1.9.4-2.fc23.src.rpm
Build Date  : Thu May 26 15:25:52 2016
Build Host  : buildvm-16.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://subversion.apache.org/
Summary     : A Modern Concurrent Version Control System
Description :
Subversion is a concurrent version control system which enables one
or more users to collaborate in developing and maintaining a
hierarchy of files and directories while keeping a history of all
changes.  Subversion only stores the differences between versions,
instead of every complete file.  Subversion is intended to be a
compelling replacement for CVS.

Questions:

  1. Why?
  2. How to avoid, when executed from a script?
hidefromkgb
  • 5,834
  • 1
  • 13
  • 44
  • Why don't you directly get the folder of interest where you are with `svn co root_dir/level1/level2/level3/level4` – Jon Aug 09 '17 at 13:39
  • @Jon Because of this: `Skipped 'root_dir/level1/level2/level3/level4' svn: E155007: None of the targets are working copies` – hidefromkgb Aug 09 '17 at 13:48
  • And also because I need the directory structure to be intact. – hidefromkgb Aug 09 '17 at 13:50
  • sorry, I typed too fast: `svn co https://some.repo/branches/branch1/root_dir/level1/level2/level3/level4`, that way the structure is still intact in the repo, but you only check out what you need – Jon Aug 09 '17 at 13:52
  • @Jon anyway, the second still holds: the directory structure must be preserved. – hidefromkgb Aug 09 '17 at 13:54
  • From: https://stackoverflow.com/questions/9070190/svn-no-longer-writes-svn-in-all-sub-folders, svn 1.9.X should not have a .svn in subfolders anymore. Can you perform a `yum info subversion`? – Jon Aug 09 '17 at 14:08
  • @Jon Done, see the question. – hidefromkgb Aug 09 '17 at 14:57

0 Answers0