You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Andrew Haley <ap...@redhat.com> on 2006/03/01 14:10:31 UTC

Subversion svn client doesn't show branch when checking in

Forgive me if this is a FAQ, but I haven't been able to find it in
issue tracker or the lists.

When I do a commit, svn doesn't tell me which branch I'm committing
to.  So, when I check in the log, I have no way to know which files
I'm about to overwrite.  This is a regression from CVS, which does
tell me which branch I'm committing to.

'svn diff' doesn't show the paths either, which I find annoying but is
something I can live with.  The lack of the full path in the commit
message isn't.

I've made a patch to svn (attached) which makes it do something
better, but as it seems so obviously wrong at the moment I'm quite
mystified why it works in this way.

Andrew.


Index: subversion/svn/util.c
===================================================================
*** subversion/svn/util.c	(revision 18657)
--- subversion/svn/util.c	(working copy)
***************
*** 525,538 ****
            svn_client_commit_item2_t *item
              = APR_ARRAY_IDX(commit_items, i, svn_client_commit_item2_t *);
!           const char *path = item->path;
            char text_mod = '_', prop_mod = ' ', unlock = ' ';
  
            if (! path)
!             path = item->url;
!           else if (! *path)
!             path = ".";
! 
!           if (path && lmb->base_dir)
!             path = svn_path_is_child(lmb->base_dir, path, pool);
  
            /* If still no path, then just use current directory. */
--- 525,533 ----
            svn_client_commit_item2_t *item
              = APR_ARRAY_IDX(commit_items, i, svn_client_commit_item2_t *);
!           const char *path = item->url;
            char text_mod = '_', prop_mod = ' ', unlock = ' ';
  
            if (! path)
!             path = item->path;
  
            /* If still no path, then just use current directory. */

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Subversion svn client doesn't show branch when checking in

Posted by Johan Appelgren <jo...@gmail.com>.
On 3/1/06, Andrew Haley <ap...@redhat.com> wrote:
> Forgive me if this is a FAQ, but I haven't been able to find it in
> issue tracker or the lists.
>
> When I do a commit, svn doesn't tell me which branch I'm committing
> to.  So, when I check in the log, I have no way to know which files
> I'm about to overwrite.  This is a regression from CVS, which does
> tell me which branch I'm committing to.
>
> 'svn diff' doesn't show the paths either, which I find annoying but is
> something I can live with.  The lack of the full path in the commit
> message isn't.
>
> I've made a patch to svn (attached) which makes it do something
> better, but as it seems so obviously wrong at the moment I'm quite
> mystified why it works in this way.
>
> Andrew.

Have you tried using "svn info" ? At least I think it is the
repository URL of the current directory in your working copy you are
interested in.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Subversion svn client doesn't show branch when checking in

Posted by Kris Deugau <kd...@vianet.ca>.
Ryan Schmidt wrote:
> Subversion does branching completely differently than CVS. Have you  
> read the book? A branch in Subversion is absolutely nothing more than  a 
> plain directory. Whatever directory you checked out from (or  
> subsequently switched to) is the one you're committing to.

Well, yes.  But what did I check out?

I can't comment on the CVS-vs-SVN differences with any authority as I've 
never used CVS.  But I too have trouble remembering which branch I'm 
committing to sometimes - some indication on commit would make accurate 
log messages easier to construct.

As for workarounds, there are a few workflow habits I try to use that 
may help the OP.

-> Know what part of the code you're working on, or where you checked 
out from.  Unfortunately, if you regularly switch from one code segment 
to another by svn switch (or the CVS equivalent - if any), this isn't 
easy.  (I have trouble with this on a small scale sometimes - never mind 
what I can imagine might happen with a much larger project!  But I also 
have my development environment for one project set up so that this is 
easier;  I have separate checkouts for /trunk, /branches/stable (where I 
keep the latest *production* code), and a third working copy for merging 
or work on a feature branch.  The last is the most difficult to remember 
because the repo path associated with it changes where the other two don't.)

-> Run "svn info" before every commit.  That will tell you the 
repository path to the current directory.  (Or whatever directory you 
specified, if any.)  You can then add that path to your commit message.

Personally, I include the "root" path of the code branch I'm working on 
as the first line of all of my log messages - for instance, any changes 
on the trunk have "/trunk" as the first line of the commit message;  any 
changes to a feature branch will have "/branches/<feature>", commits to 
the stable production code will have "/branches/stable".  This includes 
changes that are deep in the tree!  You may want to include more of the 
path if it's a big tree.

If nothing else, that makes "svn log <repo>" a little clearer on where 
work was done for any given commit.

-kgd

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Subversion svn client doesn't show branch when checking in

Posted by Vincent Starre <vs...@comcast.net>.
Andrew Haley wrote:

>Ryan Schmidt writes:
> > On Mar 1, 2006, at 15:10, Andrew Haley wrote:
> > 
> > > When I do a commit, svn doesn't tell me which branch I'm committing
> > > to.  So, when I check in the log, I have no way to know which files
> > > I'm about to overwrite.  This is a regression from CVS, which does
> > > tell me which branch I'm committing to.
> > 
> > Subversion does branching completely differently than CVS. Have you  
> > read the book? 
>
>Yes.
>
> > A branch in Subversion is absolutely nothing more than a plain
> > directory.
>
>Yes.
>
> > Whatever directory you checked out from (or subsequently switched
> > to) is the one you're committing to.
>
>The same is true of CVS, but it displayed the real place that the
>files were being committed to.
>
>When I type a commit message for gcc.c, I need to know that it's gcc.c
>on my experimental branch, not in the trunk.  With CVS, I could tell
>that, but with svn I can't.  And it's nothing to do with Subversion
>per se, it's just the svn client.
>
>It's nothing to do with the way that svn works internally, because the
>simple patch that I attached changes svn to provide all the
>information that CVS did.
>
>So, what is the advantage of hiding the destination URL for the files?
>
>Andrew.
>
Agreed. SVN should at least have a way of displaying complete paths in 
the commit message template (this has gotten me in trouble a number of 
times when doing imports- though for checkins you could use svn info)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Subversion svn client doesn't show branch when checking in

Posted by Andrew Haley <ap...@redhat.com>.
Ryan Schmidt writes:
 > On Mar 1, 2006, at 15:10, Andrew Haley wrote:
 > 
 > > When I do a commit, svn doesn't tell me which branch I'm committing
 > > to.  So, when I check in the log, I have no way to know which files
 > > I'm about to overwrite.  This is a regression from CVS, which does
 > > tell me which branch I'm committing to.
 > 
 > Subversion does branching completely differently than CVS. Have you  
 > read the book? 

Yes.

 > A branch in Subversion is absolutely nothing more than a plain
 > directory.

Yes.

 > Whatever directory you checked out from (or subsequently switched
 > to) is the one you're committing to.

The same is true of CVS, but it displayed the real place that the
files were being committed to.

When I type a commit message for gcc.c, I need to know that it's gcc.c
on my experimental branch, not in the trunk.  With CVS, I could tell
that, but with svn I can't.  And it's nothing to do with Subversion
per se, it's just the svn client.

It's nothing to do with the way that svn works internally, because the
simple patch that I attached changes svn to provide all the
information that CVS did.

So, what is the advantage of hiding the destination URL for the files?

Andrew.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Subversion svn client doesn't show branch when checking in

Posted by Vincent Starre <vs...@comcast.net>.
On Mar 1, 2006, at 15:10, Andrew Haley wrote:

>
>> When I do a commit, svn doesn't tell me which branch I'm committing
>> to.  So, when I check in the log, I have no way to know which files
>> I'm about to overwrite.  This is a regression from CVS, which does
>> tell me which branch I'm committing to.
>
I dont know anything about CVS, but I have found it annoying that SVN 
doesnt show branch names in the log. A relatively simple hook script can 
add this functionality, though. (I have one [perl] I can give, but it's 
longer than I usually post to a mailing list, so I wont spam it here 
unless you actually want it)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Subversion svn client doesn't show branch when checking in

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 1, 2006, at 15:10, Andrew Haley wrote:

> When I do a commit, svn doesn't tell me which branch I'm committing
> to.  So, when I check in the log, I have no way to know which files
> I'm about to overwrite.  This is a regression from CVS, which does
> tell me which branch I'm committing to.

Subversion does branching completely differently than CVS. Have you  
read the book? A branch in Subversion is absolutely nothing more than  
a plain directory. Whatever directory you checked out from (or  
subsequently switched to) is the one you're committing to.

http://svnbook.red-bean.com/en/1.1/apas05.html


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org