Subversion: How to find the differences between two tags?

前端 未结 6 1436
悲哀的现实
悲哀的现实 2020-12-29 10:15

I know that a diff between two tags lists the \'files\' which have been changed between those two tags by the following method.

svn diff tag1 tag2 |grep In         


        
相关标签:
6条回答
  • 2020-12-29 10:48

    The following shell script takes a SOURCE and a DEST, and shows changesets in SOURCE that has not been merged into DEST.

    So, to answer the original question:

    svnincoming ^/tags/TAG1 ^/tags/TAG2
    

    Or to see changes in trunk that hasn't been merged into the working copy branch:

    cd /working/copy/
    svnincoming ^/trunk
    

    The svnincoming script:

    #!/bin/sh -e
    
    SOURCE="$1"
    DEST="${2:-.}"
    
    if [ "$SOURCE" = "" ]; then
        echo "Usage: `basename $0` SOURCE[@REV] [DEST[@REV]]"
        echo "List revisions eligible for merging from SOURCE to DEST (or '.', if omitted)."
        exit 1
    fi
    
    svn mergeinfo --show-revs eligible "$SOURCE" "$DEST" | sed 's/^/-/' | xargs -d '\n' svn log "$SOURCE"
    
    0 讨论(0)
  • 2020-12-29 10:56

    Since SVN version 1.9 you have --log option for svn mergeinfo:

    svn mergeinfo --log --show-revs eligible SOURCE TARGET
    
    0 讨论(0)
  • with svn version 1.9.7, although my tags are not in the same branch, it works !

    svn diff --old=URL_TAG_1 --new=URL_TAG_2
    
    0 讨论(0)
  • 2020-12-29 11:00

    If you want a list of revisions that could be merged from one tag to another, you can generate it with the following:

        svn mergeinfo --show-revs eligible URL_TAG_1 URL_TAG_2
    
    0 讨论(0)
  • 2020-12-29 11:02

    If you want to know which files have been changed between two tags use in a working copy:

    svn merge --dry-run URL_TAG_1 URL_TAG_2
    
    0 讨论(0)
  • 2020-12-29 11:03

    You can first find the revisions of the tags:

    svn info http://svn.twig-project.org/tags/RELEASE_0_9_7 | grep 'Last Changed Rev'
    Last Changed Rev: 331
    
    svn info http://svn.twig-project.org/tags/RELEASE_0_9_8 | grep 'Last Changed Rev'
    Last Changed Rev: 343
    

    You're not really looking for a diff, you are looking for a log. So do a verbose log between those revisions and you will get the commits including changed files.

    svn log -v -q -r 331:343 http://svn.twig-project.org/trunk
    
    ------------------------------------------------------------------------
    r332 | fabien | 2010-06-12 18:30:02 +0200 (Sat, 12 Jun 2010)
    Changed paths:
       M /trunk/CHANGELOG
       M /trunk/lib/Twig/Environment.php
    ------------------------------------------------------------------------
    r333 | fabien | 2010-06-12 18:45:04 +0200 (Sat, 12 Jun 2010)
    Changed paths:
       M /trunk/CHANGELOG
       M /trunk/lib/Twig/Environment.php
    
    0 讨论(0)
提交回复
热议问题