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

Re: [PATCH] Add -cHEAD support (issue #3041)

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 20 Feb 2008 16:37:17 +0000

Hi Charles.

Why do you want to add "-cHEAD", and most importantly, what do you want it to mean?

"-r HEAD" always means the latest revision (current state) of whatever targets
we're looking at.

If "-c HEAD" is supposed to mean
   "{repository-youngest-rev - 1}:{repository_youngest_rev}"
then, on most branches, most of the time, it evaluates to a null change,
because the repository youngest revision didn't change whatever branch we're
looking at. That's not useful in general.

If "-c HEAD" is supposed to mean
   "the latest change to TARGETS" (more detail needed on whether multiple
targets are to be treated as a whole or separately)
then that might be of interest, but can't be calculated /a priori/.

I'm afraid I can't see this current patch being useful as it is. Maybe I've
missed something.

- Julian

Charles Acknin wrote:
> It's been a little while since this task is in my todo list. The code
> I sent a few months ago to the list got some brush up and I updated to
> the taste of the day (rev-ranges and so on).
> (Previous post: http://svn.haxx.se/dev/archive-2007-08/0142.shtml)
> Intended for 'svn diff' at the beginning, it turns out to work for
> 'svn merge' and 'svn log' too since both of these commands use the 'c'
> option. So we can use 'svn diff -cHEAD' as much as 'svn merge -r1:3
> -cHEAD', for example.
> Since we don't have any revision keyword for 'HEAD - 1', I introduced
> a new entry to svn_opt_revision_kind enum to take care of that (Say
> hello to svn_opt_revision_prior). However, this is *not* a new
> revision keyword, it is only used here internally and the server never
> knows we're querying for 'HEAD - 1'.
> I don't think it's worth adding a new PRIOR (or something) keyword to
> the client and server exposure.
> PASSed all tests.
> [[[
> Add support for -cHEAD (affects svn {diff,log,merge}).
> * subversion/include/svn_opt.h
> (svn_opt_revision_kind): Add svn_opt_revision_prior to represent
> "HEAD - 1".
> * subversion/libsvn_subr/opt.c
> (parse_one_rev): Add a case for negative numbers as 'diff -c N' is now
> using this function.
> * subversion/libsvn_client/revisions.c
> (svn_client__get_revision_number): Do the same as
> svn_opt_revision_head for svn_opt_revision_prior, minus one.
> * subversion/svn/main.c
> (main): Use svn_opt_parse_revision() instead of strtol() to read
> '-c''s revision argument (numeric or HEAD) and adapt to support HEAD
> argument.
> * subversion/tests/cmdline/diff_tests.py
> (diff_change_head_keyword): New test.
> (test_list): Add the test.
> ]]]
> Hope it gets some more appeal. Suggestions welcome!
> Charles

To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-02-20 17:37:33 CET

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.