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

--change and multiple changes (Issue #1213)

From: Karl Chen <quarl_at_NOSPAM.quarl.org>
Date: 2005-10-31 11:43:45 CET

I think --change is a great new command-line parameter.

I would like to re-raise my wishlist issue from 2.5 years ago,
issue #1213 titled "--revision PREVX enhancement wish".

Briefly, one usage scenario that I and others do often is to
iterate sequentially through changes to one particular file. This
is OK with some GUIs, but quite annoying when all you have is 'svn
log' and a command-line or vc-svn.el.

So I wish for an easy way to say "show me the diff of 1 change
ago", "show me the diff of 2 changes ago", etc., where by
"changes" I mean CVS's idea of file revision, not repository
revision. At the time I suggested the syntaxes "svn diff
--revision PREV2" or "svn diff --revision -2:1234".

Now that there is --change, and we are adding new code, I think it
is a great opportunity to implement this enhancement. As the 1213
thread shows, there was confusion over "N changes" vs "N
revisions". So --change is perfect :)

Here are new suggested syntax and meanings. Suppose there were
commits for foo.txt at revisions 10,20,30,40,50,60, and HEAD = 70

The following are all equivalent for this example:
svn diff --revision 59:60 foo.txt
svn diff --revision PREV:COMMITTED foo.txt
svn diff --change -1:COMMITTED foo.txt = diff -r 59:60 foo.txt
svn diff --change -1:HEAD foo.txt = diff -r 59:60 foo.txt
svn diff --change -1 foo.txt = diff -r 59:60 foo.txt
svn diff --change COMMITTED foo.txt

More examples:

svn diff --change -1:50 foo.txt = diff -r 49:50 foo.txt
svn diff --change -1:55 foo.txt = diff -r 49:50 foo.txt
svn diff --change -2:55 foo.txt = diff -r 39:50 foo.txt
svn diff --change -2:HEAD foo.txt = diff -r 49:60 foo.txt
svn diff --change -2 foo.txt = diff -r 49:60 foo.txt

svn diff --change HEAD:-1 foo.txt = diff -r 60:59 foo.txt
svn diff --change 50:-1 foo.txt = diff -r 50:49 foo.txt
svn diff --change 55:-1 foo.txt = diff -r 50:49 foo.txt
svn diff --change 55:-2 foo.txt = diff -r 50:39 foo.txt

Here, "--change -1:N" is different from "--change N". "--change
N" is equivalent to "--revision (N-1):N", but "--change -1:N" is
equivalent to "--revision (M-1):M" where M is the last COMMITTED
revision <= N (similar to the difference between HEAD and
COMMITTED).

The --change -N:M syntax might require a change to the
command-line parsing. I'm just suggesting one syntax; what I
really care about is the functionality.

-- 
Karl 2005-10-31 02:00
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 31 11:47:51 2005

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