SVN/CVS and Branching

andrew cooke andrew at acooke.org
Thu Feb 19 07:20:05 EST 2009


Ah, OK.  I have never worked like that.  The only helpful comment I can
think of is that I believe svn will store links correctly (while CVS
doesn't).

However, I do find the whole approach a bit odd.  You seem to be doing
your own versioning "by hand" (having two packages that are equivalent
with different names), where I would leave that to SVN/CVS.  So what I
would do, and what seems to me a more natural way to use version control,
is to branch the entire project (the whole tree), leave the foo module
name the same, and work on two separate projects.  If changes (ie on
modules other than foo) need to be made to both projects I would use
svnmerge to make sure that merges made to one also apply to the other. 
But if that is a common situation then it suggests the other modules might
be better treated as a separate library, with their own project.

On the other hand, svnmerge is a bit of a pain and I can see how your
approach might make more sense (particularly on smaller projects).

Andrew


Jeff Dyke wrote:
> Fair enough.  Say my project is called foo, and it has many
> submodules.  So there are imports that may look like `import foo.bar`
> or `from foo.bar import baz`, if i change the top level directory, it
> is no longer foo and then those imports do not work as originally
> written.  The way i currently do this  is to create a branch, say
> foo2, and create a symbolic link named foo pointing at foo2, after
> renaming foo, when i want to work on the branch and remove the link
> when i want to work on the head.  This actually works fine, but
> thought there may be a better way.
>
> Jeff
>
> On Wed, Feb 18, 2009 at 7:40 PM, andrew cooke <andrew at acooke.org> wrote:
>>
>> maybe this is just me, but i don't have a clue what your problem is.
>> what
>> does "starting imports all over the place" mean?  what do you mean by
>> "retired"?
>>
>> i use svn with python in exactly the same way as with java (and, i
>> thought, in the same way as anyone uses svn with any language; java uses
>> the directory structure as a package structure too).
>>
>> maybe someone else will reply, but if not it might help to explain a
>> little more detail.
>>
>> andrew
>>
>>
>> Jeff Dyke wrote:
>>> Hello.  I am curious about different ideas on how you handle branching
>>> your python projects.  With some other languages this is trivial, but
>>> since python uses these directories as modules and i have the top
>>> level module starting imports all over the place, i am wondering what
>>> others do.  In the past we had retired the first branch and just moved
>>> towards the new, but that is not possible now.
>>
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>





More information about the Python-list mailing list