The easiest way to collect change history since the last merge in Subversion

I usually make a few changes in my branch and sometimes merge with the chest. I would like to keep all of my commit messages in my last note on the revision of the final merger of the trunk. I don’t want to remember version numbers or something that I just want “all the commit messages to the branch since the last merge to the trunk” are collected together in an editable way before I commit.

Since this information is only available in mergeinfo, I think that this should be provided to the client. I did not find this feature in TortoiseSVN, SVN Monitor, or the command line client. Any chance I'm missing something obvious?

+3
source share
4 answers

I hope I understood your requirement correctly. You can try the following steps: (via the svn command line client):

  • svn log -v --stop-on-copy http://myrepo/mybranch givesenter a report that you can use to find out the version number representing your last merge from branch to trunk. (Xxxx)

  • svn log -rXXXX:HEAD http://myrepo/mybranch > commitmessg.txt(Suppose you now want to combine the HEAD form of your branch version into a trunk) - this will collect all your commit messages into a text file. You can edit this file to include a meaningful first line, for example, “Merge elements as shown below” or “Merge all elements related to fixing the && & defect”, etc., and save.

  • Merge as usual

  • svn commit -F commitmessg.txt, . ( , )

, .

EDIT: ( TORTOISESVN)

SVN. SVN-Show, , ( ). - - . ( , .) .

+3

, , mergeinfo svn log xargs. :

svn mergeinfo $SOURCE $DESTINATION --show-revs eligible | xargs -i  svn log $SOURCE -r '{}'
+3

, @tschaible :

$ svn mergeinfo --show-revs=eligible ^/branches/version | tr "\\n" "," | xargs -i svn log -c {} ^/branches/version

, , @tschaible, , svn log , . , ~/.bash_aliases :

alias svnlog='tr "\\n" "," | xargs -i svn log -c {}'

:

svn mergeinfo --show-revs=eligible ^/branches/version | svnlog ^/branches/version
+2

, SVN 1.7 svnmerge, script .

, bash script :

#!/bin/bash

usage() {
cat << EOF

    usage: $0 options

    Script to simplify merging and commiting to prelive 

    OPTIONS:
       -h      Show usage
       -r      Specify file to use
       -s      Merge source location 
       -d      Place where You want ot merge 

EOF
}

SOURCE= 
DESTANATION= 
REV= 
# Provide revision number or list of revisions
while getopts "hr:s:d:" OPTION; do 
    case $OPTION in 
        h) 
            usage
            exit 1
            ;;  
        r) 
            REV=$OPTARG
            ;;
        s)
            SOURCE=$OPTARG
            ;;
        d)
            DESTANATION=$OPTARG
            ;;
    esac
done

# Create commit message file 
echo "Preperign commit info file..."
FILE=commit-info.txt
touch $FILE
echo "Merged revision(s) $REV via costom merge script from" > $FILE
svn info $SOURCE | grep 'URL' | awk '{print $NF}' >> $FILE

LIST=`echo "$REV" | tr ',' ' '`

# Get commit messages from source location 
echo "" >> $FILE
for commit in $LIST
do
    svn log $SOURCE -r $commit >> $FILE
    echo "" >> $FILE
done
echo "Done...."

# Merge changes from source location 
echo "Starting merge....."
svn merge -c$REV $SOURCE
echo "Done merging...."

# Commit changes to destanation 
echo "Start commiting files to SVN...."
svn commit -F $FILE
rm $FILE
echo "Complete"
0

Source: https://habr.com/ru/post/1723092/


All Articles