[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

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

From: <kfogel_at_collab.net>
Date: 2006-03-08 14:38:08 CET

Andrew Haley <aph@redhat.com> writes:
> OK, I'm moving this to dev@subversion.tigris.org as it's a patch
> submission.
>
> To recap: the svn client doesn't provide the full URL of a target file
> when it opens the editor for "svn commit". Instead, it provides the
> local file name. There's no way at that point to tell where in the
> repository a file you'll be committing will go.
>
> Because of this, if I do "svn commit" in a private branch I get no
> confirmation that files really will be committed to a private branch,
> not (for example) the trunk.
>
> This is unnecessarily user-unfriendly, and it is a regression from
> cvs, which does tell you which branches a file will be committed to.
> It is true that you can use "svn info" before you use "svn commit",
> but that's making extra work for the svn user.
>
> As far as I can see from the source code of svn/util.c, this is quite
> deliberate: svn has all the information, but it is hidden from the
> user.
>
> The only disadvantage I can see to applying this patch is that the
> filenames in the editor will be longer.

Folks, I'm mildly inclined toward applying this patch, *if* we don't
count the path style in the $EDITOR templates to be an API that can't
be changed before 2.0. I don't think it's really an API -- programs
that want the modified paths in a working copy in local style are most
likely using 'svn status' anyway.

Andrew has already pointed out the advantages. There is a slight
disadvantage in that that one must transform URLs to local paths if
one wants to use the local paths in the log message, but that's a
largely automatable transformation, and IMHO is outweighed by the
advantage of having on-the-spot confirmation that one is indeed
committing from the branch one thought one was. (Even we make the
wrong-branch mistake sometimes, for example see r16946.)

I haven't tested the patch yet, haven't made sure the item->url is
present even for added-but-not-yet-committed files, etc (Andrew, have
you tested that?). I'm just indicating tentative approval of the
general idea, and soliciting comments from others. Thoughts?

-Karl

-- 
www.collab.net  <>  CollabNet  |  Distributed Development On Demand
> 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: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 
> 
-- 
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 8 17:47:40 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.