You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by mark jason <ma...@gmail.com> on 2010/12/22 13:42:27 UTC

changing the structure of code in public repo

hi,
My former team member had put some code in a public repository
sometime back.Currently I am the sole team member now and need to
modify the code.
I am relatively new to subversion and version control systems in
general..

I can checkout the code using
svn checkout https://myproject.somepublicrepo.com/svn/trunk/

the source tree structure in repo is
svn/trunk/src/myproject/One.java
                                  /Two.java

I thought of  changing the package structure of code as follows,
myproject/
         /build.xml
         /src
             /packageone/NewOne.java
             /packagetwo/Two.java
         /lib
         /images

How should I go about this? should I checkout into a work dir and then
delete all of its contents ,then create the new code structure and
then commit ?
Or should I delete the directories from repo first?

Any help appreciated
regards
mark

Re: changing the structure of code in public repo

Posted by Ulrich Eckhardt <ul...@dominolaser.com>.
On Wednesday 22 December 2010, mark jason wrote:
> I am relatively new to subversion and version control systems in
> general..

Read the introduction in the book (see my signature). Set up a toy repository 
for testing things. You can even clone the life repository if you want to 
check how things work.

> the source tree structure in repo is
> svn/trunk/src/myproject/One.java
>                        /Two.java
>
> I thought of  changing the package structure of code as follows,
> myproject/
>          /build.xml
>          /src
>              /packageone/NewOne.java
>              /packagetwo/Two.java
>          /lib
>          /images
>
> How should I go about this? should I checkout into a work dir and then
> delete all of its contents ,then create the new code structure and
> then commit ? Or should I delete the directories from repo first?

Neither. ;) If you just delete things, you will lose the history, but I guess 
you only want to move/rename/restructure.

Here's what I would do:

1. Check out the 'myproject' folder first.
2. Then, inside that working copy, create the new folders and add them to 
Subversion (svn add).
3. Then, move the two Java files into their target folders. Note that renaming 
and moving is the same for Subversion.
4. Then, check the state (svn state) of the working copy, you should have the 
two Java files in their original place marked as deleted and the new/moved 
files and folders as added.
5. If that is as you expect it to be, commit to the repository (svn commit).
6. Lastly, check out the whole folder again (to a different location) and 
verify that the content is as you expected it to be.

Good luck!

Uli


-- 
ML: http://subversion.apache.org/docs/community-guide/mailing-lists.html
FAQ: http://subversion.apache.org/faq.html
Docs: http://svnbook.red-bean.com/


**************************************************************************************
Domino Laser GmbH, Fangdieckstraße 75a, 22547 Hamburg, Deutschland
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
**************************************************************************************
Visit our website at <http://www.dominolaser.com/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Domino Laser GmbH ist für diese Folgen nicht verantwortlich.
**************************************************************************************


RE: changing the structure of code in public repo

Posted by Bob Archer <Bo...@amsi.com>.
> My former team member had put some code in a public repository
> sometime back.Currently I am the sole team member now and need to
> modify the code.
> I am relatively new to subversion and version control systems in
> general..
> 
> I can checkout the code using
> svn checkout https://myproject.somepublicrepo.com/svn/trunk/
> 
> the source tree structure in repo is
> svn/trunk/src/myproject/One.java
>                                   /Two.java
> 
> I thought of  changing the package structure of code as follows,
> myproject/
>          /build.xml
>          /src
>              /packageone/NewOne.java
>              /packagetwo/Two.java
>          /lib
>          /images
> 
> How should I go about this? should I checkout into a work dir and
> then
> delete all of its contents ,then create the new code structure and
> then commit ?
> Or should I delete the directories from repo first?

No, don't just delete then replace. Use the svn commands to do your refactoring. Basically the svn move command. Once you have done all your refactoring commit your changes.

Have you read the free svn book? Specifically the "basic usage" chapter?

BOb

Re: changing the structure of code in public repo

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag mark jason,
am Mittwoch, 22. Dezember 2010 um 14:42 schrieben Sie:

> How should I go about this?

First of all you should read at a least a bit through the docs and get
to know about best practices, what is possible etc.

http://svnbook.red-bean.com/nightly/en/svn-book.html

> should I checkout into a work dir and then
> delete all of its contents ,then create the new code structure and
> then commit ?
> Or should I delete the directories from repo first?

There's no need to delete, you can move and copy files and directories
while keeping their history.

http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.tour.importing.layout

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning
AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig
 
Telefon: Potsdam: 0331-743881-0
E-Mail:  tschoening@am-soft.de
Web:     http://www.am-soft.de

AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow