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

Re: --change and multiple changes (Issue #1213)

From: Karl Chen <quarl_at_NOSPAM.quarl.org>
Date: 2005-11-03 04:45:53 CET

To support something like "diff 5 changes before revision 123
against 10 changes before revision 678" we'd need a more general
syntax. Here's another suggestion:

  svn diff -r 123~5:678~10 foo.txt

Thus the syntax for specifying a revision would be the usual
integer revision N, or:

  [N]~[+|-]C

    - If N is not specified, defaults to current working version
      or HEAD.

    - The '~' indicates that what follows is a difference in
      number of changes

    - '+' means add changes; '-' means subtract changes; omitted
      defaults to subtract changes

    - C specifies the number of changes

Examples:

    svn diff -r HEAD~5:HEAD~0 Diff 5 changes ago against HEAD
    svn diff -r ~5 Diff 5 changes ago against HEAD

    svn diff -r HEAD~2:HEAD~3 Diff 2 changes ago against 3
                                 changes ago
    svn diff -r ~2:~3 Diff 2 changes ago against 3
                                 changes ago

    svn diff -r 123~1:123 Diff 1 change before 123

    svn diff -r 123:123~+1 Diff 1 change after 123

Delimiter alternatives:

    - 123-5, 456+10

    - 123~-5 or 123~5, 456~+10

    - 123~-5, 456~+10

    - 123#-5, 456#+10

    - 123<<5, 456>>10
   
    I don't like 123-5:456+10 because that looks confusingly like
    118:466. The syntax should make it obvious that this is
    something different than just adding/subtracting integers.

    I like 123~5 and 123<<5.

Default value alternatives:

    - If N is specified but M is not, then M defaults to N[~C]; if
      M is specified but N is not, then N defaults to M[~C]
      E.g.
         svn diff -r 123:~+1
         svn diff -r ~1:123

      This could be cryptic or error-prone.

    - Use '%' or other character to specify "the value of the
      left/right- hand side" E.g.

         svn diff -r %<<5:123 Diff 5 changes before 123
         svn diff -r 123:%>>5 Diff 5 changes after 123

         svn diff -r %<<1:123<<5 Diff 1 change before 5 changes
                                    before 123

(--change is no longer relevant; it would be extending the
revision syntax everywhere.)

-- 
Karl 2005-11-02 19:00
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 3 04:49:13 2005

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