Discussion:
Can import also convert the source to a working copy
Bo Berglund
2018-03-15 10:48:31 UTC
Permalink
I have used this sequence for handling new projects with svn:

- Start a new project in whatever IDE is used
- Work a bit on initial code so the framework is OK
- Exit the IDE
- Command prompt in the parent of the project dir
- svn import <project dir name> <svn URL> --depth files -m "message"
- rename <project dir> <something else>
- svn co <svn URL> <project dir>
- move <something else>\<all subdirs> <project dir>\
- delete <something else>
- start dev IDE again and hopefully find that it loads properly

I want to avoid having to do all the steps following the svn import
command so I can just continue working where I was when I wanted to
put the project under version control.
Specifically there may be ignored files in the project dir that are
needed by the dev IDE but should not be versioned and I would like
these to be intact yet not part of the versioning. I have svn ignores
in my config file so they won't be part of the import and therefore
they will not appear after the following checkout...

Is there some flag or such that can help out during the import or in a
following checkout so that the extra directory >something else> does
not need to be used?

Or can I just move the .svn dir from the working copy to the original
project and then it will be converted in place?
--
Bo Berglund
Developer in Sweden
Johan Corveleyn
2018-03-15 11:03:53 UTC
Permalink
Post by Bo Berglund
- Start a new project in whatever IDE is used
- Work a bit on initial code so the framework is OK
- Exit the IDE
- Command prompt in the parent of the project dir
- svn import <project dir name> <svn URL> --depth files -m "message"
- rename <project dir> <something else>
- svn co <svn URL> <project dir>
- move <something else>\<all subdirs> <project dir>\
- delete <something else>
- start dev IDE again and hopefully find that it loads properly
I want to avoid having to do all the steps following the svn import
command so I can just continue working where I was when I wanted to
put the project under version control.
Specifically there may be ignored files in the project dir that are
needed by the dev IDE but should not be versioned and I would like
these to be intact yet not part of the versioning. I have svn ignores
in my config file so they won't be part of the import and therefore
they will not appear after the following checkout...
Is there some flag or such that can help out during the import or in a
following checkout so that the extra directory >something else> does
not need to be used?
Or can I just move the .svn dir from the working copy to the original
project and then it will be converted in place?
See http://subversion.apache.org/faq.html#in-place-import
--
Johan
Bo Berglund
2018-03-15 14:21:35 UTC
Permalink
On Thu, 15 Mar 2018 12:03:53 +0100, Johan Corveleyn
Post by Johan Corveleyn
Post by Bo Berglund
Is there some flag or such that can help out during the import or in a
following checkout so that the extra directory >something else> does
not need to be used?
Or can I just move the .svn dir from the working copy to the original
project and then it will be converted in place?
See http://subversion.apache.org/faq.html#in-place-import
Seems like the best option is as follows:
-----------------------------------------
svn import WiFiConfig <url>/WiFiConfig/trunk --depth files -m "msg"
svn co <url>WiFiConfig/trunk --force WiFiConfig

I.e. First import the directory and then immediately check out the
same with --force

It still takes some time because I think svn needs to download the
files into the cache in the .svn directory.
I have a rather slow connection to the server from where I am...
--
Bo Berglund
Developer in Sweden
Kris Deugau
2018-03-15 17:45:13 UTC
Permalink
Post by Bo Berglund
On Thu, 15 Mar 2018 12:03:53 +0100, Johan Corveleyn
Post by Johan Corveleyn
See http://subversion.apache.org/faq.html#in-place-import
-----------------------------------------
svn import WiFiConfig <url>/WiFiConfig/trunk --depth files -m "msg"
svn co <url>WiFiConfig/trunk --force WiFiConfig
I.e. First import the directory and then immediately check out the
same with --force
It still takes some time because I think svn needs to download the
files into the cache in the .svn directory.
I have a rather slow connection to the server from where I am...
Unless I misread your original post, the very first option in that link
looks like a better fit. To rephrase it somewhat for your case:

1) Create a repository or a directory in the repository
2) Create your local files
3) Check out the empty repository path to your workspace - this won't
overwrite any of your files
4) svn add [files]
5) svn ci
6) Continue working as usual

This avoids a round trip to the server to push the current files, then
pull them back down to create the formal SVN working copy with things
already in it - instead you "check out" an empty directory which should
be quite fast.

-kgd
Bo Berglund
2018-03-15 19:18:02 UTC
Permalink
Post by Kris Deugau
Unless I misread your original post, the very first option in that link
1) Create a repository or a directory in the repository
2) Create your local files
3) Check out the empty repository path to your workspace - this won't
overwrite any of your files
4) svn add [files]
5) svn ci
6) Continue working as usual
This avoids a round trip to the server to push the current files, then
pull them back down to create the formal SVN working copy with things
already in it - instead you "check out" an empty directory which should
be quite fast.
I readthat page as best I could but it looked so much Linuxish that I
lost track of how it could be done and then finding the other reply
and looking up that led me to the procedure I showed.
Also, I normally already have the files when subversion comes into
play...
--
Bo Berglund
Developer in Sweden
Branko Čibej
2018-03-15 20:37:45 UTC
Permalink
Post by Bo Berglund
Post by Kris Deugau
Unless I misread your original post, the very first option in that link
1) Create a repository or a directory in the repository
2) Create your local files
3) Check out the empty repository path to your workspace - this won't
overwrite any of your files
4) svn add [files]
5) svn ci
6) Continue working as usual
This avoids a round trip to the server to push the current files, then
pull them back down to create the formal SVN working copy with things
already in it - instead you "check out" an empty directory which should
be quite fast.
I readthat page as best I could but it looked so much Linuxish
What on earth is Linuxish about it? Files and directories exist on
Windows, too, it doesn't matter what the names are. If you can't
extrapolate instructions to your specific OS, you'll have no end of
trouble using any tool that works with files and directories ...
Post by Bo Berglund
that I
lost track of how it could be done and then finding the other reply
and looking up that led me to the procedure I showed.
Also, I normally already have the files when subversion comes into
play...
That does not matter. The point is that you check out an empty tree in
the repository over an existing tree in your local filesystem and that
will magically create a working copy with no versioned objects in it.

-- Brane
Daniel Shahaf
2018-03-16 06:54:42 UTC
Permalink
Post by Branko Čibej
Post by Bo Berglund
Post by Kris Deugau
Unless I misread your original post, the very first option in that link
1) Create a repository or a directory in the repository
2) Create your local files
3) Check out the empty repository path to your workspace - this won't
overwrite any of your files
4) svn add [files]
5) svn ci
6) Continue working as usual
This avoids a round trip to the server to push the current files, then
pull them back down to create the formal SVN working copy with things
already in it - instead you "check out" an empty directory which should
be quite fast.
I readthat page as best I could but it looked so much Linuxish
What on earth is Linuxish about it?
You don't have to use the 'svn' client; you can use any Subversion
client (a GUI client, TortoiseSVN, IDE integrations...).

The docs always use the 'svn' client because (1) it's the only non-third-
party client, (2) it's a command-line client so it's easier to give
instructions for it.

Branko Čibej
2018-03-15 11:04:20 UTC
Permalink
Post by Bo Berglund
- Start a new project in whatever IDE is used
- Work a bit on initial code so the framework is OK
- Exit the IDE
- Command prompt in the parent of the project dir
- svn import <project dir name> <svn URL> --depth files -m "message"
- rename <project dir> <something else>
- svn co <svn URL> <project dir>
- move <something else>\<all subdirs> <project dir>\
- delete <something else>
- start dev IDE again and hopefully find that it loads properly
I want to avoid having to do all the steps following the svn import
command so I can just continue working where I was when I wanted to
put the project under version control.
Specifically there may be ignored files in the project dir that are
needed by the dev IDE but should not be versioned and I would like
these to be intact yet not part of the versioning. I have svn ignores
in my config file so they won't be part of the import and therefore
they will not appear after the following checkout...
Is there some flag or such that can help out during the import or in a
following checkout so that the extra directory >something else> does
not need to be used?
Or can I just move the .svn dir from the working copy to the original
project and then it will be converted in place?
svn checkout --force

-- Brane
Continue reading on narkive:
Loading...