tags:

views:

104

answers:

3

This is a newbie question...

I got this project and I want to use the google.code svn system, but, I do not how... In fact, I am not so used to svn... Here is what I' ve done:

svnadmin create octopy_repo

svn import /home/mrt/python/Qt/octopy file:///home/mrt/octopy_repo -m "Initial import"

  Adding  (bin)  /home/mrt/python/Qt/octopy/octopus.png 
  Adding         /home/mrt/python/Qt/octopy/oct.ui
  Adding         /home/mrt/python/Qt/octopy/zipi
  Adding         /home/mrt/python/Qt/octopy/octo.py
  Adding         /home/mrt/python/Qt/octopy/main.py
  Adding         /home/mrt/python/Qt/octopy/etc
  Adding         /home/mrt/python/Qt/octopy/etc/config.list

  Committed revision 1.

mkdir octopy_working

svn checkout file:///home/mrt/octopy_repo /home/mrt/octopy_working

cd octopy_working

This is where it get stuck. First, I edit some file, and then:

svn status
  M      main.py

svn diff

  Index: main.py
  ===================================================================
  --- main.py   (revision 1)
  +++ main.py   (working copy)
  @@ -1,6 +1,6 @@
   # -*- coding: utf-8 -*-      

  -"""The user interface for our app"""
  +"""The user interface for our app some edit"""

   import os,sys
   import ConfigParser

So, great! It knows that the file main.py is edited, now I want to commit the changes:

svn commit -m "Some Text"
   Sending        main.py
   Transmitting file data .
   Committed revision 2.

But, when I look to main.py in /home/mrt/python/Qt/octopy, no changes where done...

Where it sends the changes???? I know that the changes are in "somewhere" but, where????

A: 

The changes are in file:///home/mrt/octopy_repo

Doug Currie
+2  A: 

You checked the repository out to /home/mrt/octopy_working:

svn checkout file:///home/mrt/octopy_repo /home/mrt/octopy_working

You made the changes in that directory too as you did a cd octopy_working before committing the changes.

So if you do an svn log main.py you will see the list of changes.

The actual repository where the changes are being stored is in /home/mrt/octopy_repo.

John Keyes
+6  A: 

The source directory /home/mrt/python/Qt/octopy from which you performed the import is not a working directory (and thus knows nothing about the repository). Once you have performed the import, the source is stored in a special format (which is not directly viewable) in the repository in /home/mrt/octopy_repo, and you do not actually need the imported directory any longer.

Having performed a checkout, you have a working directory in /home/mrt/octopy_working, which does know about the repository.

import ---> repository ---> working ----(edit)---+
               ^                                 |
               +-------------(commit)------------+

You made some edits in your working directory, and committed them, which sends the changes to the repository. The imported directory is never touched by svn, and because it is not a working directory, the changes will never appear in /home/mrt/python/Qt/octopy.

It is a common source of confusion that the imported directory (which we would normally treat as sacrosanct) is effectively ignored or discarded once imported. But you simply need to remember that once under subversion's control, you do all your edits in a working copy (created from a checkout).

gavinb