Discussion:
[BitPim-devel] Making branches
Roger Binns
2006-03-04 23:40:28 UTC
Permalink
If you want to make a branch then please use scripts/makebranch.py
It will only branch the subset of directories you want rather than
all of them. For example you are extremely unlikely to want to
branch the help directory.

As an example, Simon wants to work the treeview instead of tabs.
He'll need to modify files in src and the resources. So the
command he'll use is:

scripts/makebranch.py /developer/skyjunky src resources

The script will ensure the named directories are branched whereas
the others externals ("symbolic links").

Roger
Simon C
2006-03-12 19:25:12 UTC
Permalink
Post by Roger Binns
scripts/makebranch.py /developer/skyjunky src resources
The script will ensure the named directories are branched
whereas the others externals ("symbolic links").
This happens:

C:\projects\bitpim\main>scripts\makebranch.py /developer/skyjunky src
resources
svn mkdir -m "new branch on dirs ['src', 'resources'] from rev 2895 of
/trunk/bitpim" https://svn.sourceforge.net/svnroo
t/bitpim/developer/skyjunky
svn: MKCOL of
'/svnroot/bitpim/!svn/wrk/2b44cdc1-0733-5d43-bed4-65b4e0060c26/developer/sky
junky': 405 Method Not Allowed
(https://svn.sourceforge.net)
Returned code 1 ! Aborting!


I can do basic stuff like add files and commit changes from the command line
in the skyjunky directory.

Simon
Roger Binns
2006-03-12 20:41:15 UTC
Permalink
Post by Simon C
Post by Roger Binns
scripts/makebranch.py /developer/skyjunky src resources
svn: MKCOL of
'/svnroot/bitpim/!svn/wrk/2b44cdc1-0733-5d43-bed4-65b4e0060c26/developer/sky
junky': 405 Method Not Allowed
(https://svn.sourceforge.net)
Returned code 1 ! Aborting!
What version of Subversion are you using?

C:\projects\bitpim>svn --version
svn, version 1.3.0 (r17949)
compiled Jan 15 2006, 23:18:48

Copyright (C) 2000-2005 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme

Roger
Simon C
2006-03-12 21:03:12 UTC
Permalink
Post by Simon C
Post by Simon C
Post by Roger Binns
scripts/makebranch.py /developer/skyjunky src resources
svn: MKCOL of
'/svnroot/bitpim/!svn/wrk/2b44cdc1-0733-5d43-bed4-65b4e0060c26/develop
Post by Simon C
er/sky
junky': 405 Method Not Allowed
(https://svn.sourceforge.net)
Returned code 1 ! Aborting!
What version of Subversion are you using?
C:\projects\bitpim>svn --version
The same one. Are there some admin rights involved?

C:\projects\bitpim\main>svn --version
svn, version 1.3.0 (r17949)
compiled Jan 15 2006, 23:18:48

Copyright (C) 2000-2005 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet
(http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme


Simon
Roger Binns
2006-03-12 21:22:04 UTC
Permalink
Post by Roger Binns
scripts/makebranch.py /developer/skyjunky src resources
I didn't pay close attention. You are missing the branch name. ie the
command should be:

scripts/makebranch.py /developer/skyjunky/pretty src resources

Roger
Simon C
2006-03-12 21:45:35 UTC
Permalink
Post by Roger Binns
I didn't pay close attention. You are missing the branch
scripts/makebranch.py /developer/skyjunky/pretty src resources
This worked although there was an error at the end of the script


C:\projects\bitpim\main>scripts\makebranch.py /developer/skyjunky/trees src
resources
svn mkdir -m "new branch on dirs ['src', 'resources'] from rev 2895 of
/trunk/bitpim" https://svn.sourceforge.net/svnroo
t/bitpim/developer/skyjunky/trees

Committed revision 2898.
svn copy -m "branch from rev 2895 of /trunk/bitpim/resources" resources
https://svn.sourceforge.net/svnroot/bitpim/devel
oper/skyjunky/trees/resources

Committed revision 2899.
svn copy -m "branch from rev 2895 of /trunk/bitpim/src" src
https://svn.sourceforge.net/svnroot/bitpim/developer/skyjunk
y/trees/src

Committed revision 2900.
svn checkout --non-recursive --quiet --non-interactive --ignore-externals
https://svn.sourceforge.net/svnroot/bitpim/dev
eloper/skyjunky/trees __branch__
svn propset svn:externals --file __externals__ __branch__
property 'svn:externals' set on '__branch__'
==== __externals__
buildrelease
https://svn.sourceforge.net/svnroot/bitpim/subprojects/buildrelease/trunk
dev-doc https://svn.sourceforge.net/svnroot/bitpim/trunk/bitpim/dev-doc
examples https://svn.sourceforge.net/svnroot/bitpim/trunk/bitpim/examples
experiments
https://svn.sourceforge.net/svnroot/bitpim/trunk/bitpim/experiments
help https://svn.sourceforge.net/svnroot/bitpim/trunk/bitpim/help
helpers https://svn.sourceforge.net/svnroot/bitpim/trunk/bitpim/helpers
scripts https://svn.sourceforge.net/svnroot/bitpim/trunk/bitpim/scripts
---- __externals__
svn commit -m "Directories ['buildrelease', 'dev-doc', 'examples',
'experiments', 'help', 'helpers', 'scripts'] are not
branched here" __branch__
Sending __branch__

Committed revision 2901.
Traceback (most recent call last):
File "C:\projects\bitpim\main\scripts\makebranch.py", line 98, in ?
shutil.rmtree(branchdirname)
File "c:\python23\lib\shutil.py", line 142, in rmtree
raise exc[0], (exc[1][0], exc[1][1] + ' removing '+arg)
OSError: [Errno 13] Permission denied removing __branch__\.svn\dir-prop-base
Roger Binns
2006-03-12 21:59:22 UTC
Permalink
Post by Simon C
This worked although there was an error at the end of the script
...
Post by Simon C
OSError: [Errno 13] Permission denied removing __branch__\.svn\dir-prop-base
That is the reason I want to try a different way. Subversion doesn't
let you set properties on a URL - it has to be on a local working copy.
Consequently I have to check out the top level dir (as __branch__)
and then set the externals property and commit. The directory is
then removed. However programs like TortoiseSVN constantly scan
and so prevent some of the removals.

I am going to change it so that the checkout is done to a temporary
directory outside the current directory structure and all the copies
and modifications done there followed by the final checkin.

BTW their reason for not allowing propsets on URLs is because you
clobber something. There are various mailing list postings about
how silly that is. It would be fine if I could specify them when
doing the svn mkdir but they don't allow that either.

Roger
Simon C
2006-03-12 22:32:50 UTC
Permalink
The directory is then removed. However programs like
TortoiseSVN constantly scan and so prevent some of the removals.
Understood, I manually removed the __branch__ directory.

Simon
Simon C
2006-03-16 06:44:35 UTC
Permalink
Post by Roger Binns
As an example, Simon wants to work the treeview instead of tabs.
He'll need to modify files in src and the resources. So the
scripts/makebranch.py /developer/skyjunky src resources
How do I merge changes from the trunk into my branch (and visa versa at some
point in the future), I'd like to merge in changes to reduce the merge task
later on.
I've tried to use the merge tool in tortoisesvn but it does not do anything
useful.

Simon
Roger Binns
2006-03-16 09:16:07 UTC
Permalink
Post by Simon C
How do I merge changes from the trunk into my branch
You should at least read that bit of the subversion book so
you understand what is going on.
Post by Simon C
I've tried to use the merge tool in tortoisesvn but it does not do anything
useful.
It does - you just didn't feed it the right information. Assuming
you want to do the whole src directory:

- Get the log history and revision graph for src in your checked
out branch
- You'll see it was made at rev 2900, so the changes we want
to merge are from 2901 to now of src
- Right click and choose merge on the src directory
- In the from URL, put
https://svn.sourceforge.net/svnroot/bitpim/trunk/bitpim/src
- For the from revision, put 2901
- For the end URL, we want the same thing
- We'll use the head revision for the end

Hit Dry Run and you will see what would happen if the merge went
ahead. In this case you will see it would all go fine, except
for gui.py where you'll have to resolve conflicts. (Note
that subversion knows about conflicts and will mark the file
as such. You need to right click and resolve when you are
done.)

Since everything seems right, hit Merge. Check your working
copy and make any changes as appropriate and then commit.

It initially all seems counter-intuitive, but it does make sense.
Your working copy needs to be where you want the changes to happen
(ie the target of the merge). You then tell Subversion where you
want the changes to come from. (We could each have 10 branches so
it has no idea). You also have to tell it what revision number
to start at and what revision number to stop at. The relevant
changes are applied to your working copy, but not committed.
Subversion will do the right thing even if you renamed files
or the branch you grabbed stuff from renamed files.

When you do your commit, include the revision numbers. Your
message will be something like "merged changes from trunk/bitpim/src
rev 2901 to rev 2929". (You can find the current revision number
by running "svnversion .") The next time you need to do a merge,
look in the log messages and you'll see that you need to start at 2930.
(Be careful of off by one errors!)

Currently you have to track which changesets have been merged manually
by putting the numbers in commit messages. A future version of
subversion will allow this information to be tracked by subversion
directly.

If you are wondering what all those big expensive commercial version
control systems do, they give a gui and let you cherry pick which
changesets to apply and where, and remember that they have been
applied. That gets to be nice to have if you have a lot of branches
and changes you need to move amongst them.

Roger

Loading...