]> Pileus Git - ~andy/sunrise/commitdiff
scripts/sunrise-commit: Exit with informative message if svn update results in conflicts
authorAlex Tarkovsky <alextarkovsky@gmail.org>
Mon, 3 Jul 2006 18:00:28 +0000 (18:00 +0000)
committerAlex Tarkovsky <alextarkovsky@gmail.org>
Mon, 3 Jul 2006 18:00:28 +0000 (18:00 +0000)
svn path=/sunrise/; revision=456

scripts/sunrise-commit

index c99247b504a6b9aa7c2229d7155d1c88ee531f18..0c0fc158c145aa0e15a95884d9bf68baea592601 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/bash
 # sunrise-commit - Automates the Gentoo Sunrise Overlay commit process
 # Released into the public domain
-# $Id$
 
 source /sbin/functions.sh
 
@@ -118,16 +117,33 @@ svn_up() {
                        pushd .. >/dev/null
                        (( num_new_dirs++ ))
                done
+
                ebegin "Updating working copy to latest version from repository"
+
                if [[ "$opt_verbose" == "1" ]] ; then
                        svn update || set $?  
                else
                        svn update -q || set $?
                fi
+
                eend ${1:-0}
+
                for (( i=num_new_dirs ; i > 0 ; i-- )) ; do
                        popd >/dev/null
                done
+
+               local conflict_files=$(svn status | sed -rn 's/^C.+ ([^ ]+)$/\1/p')
+               if [[ -n "$conflict_files" ]] ; then
+                       echo "!!! Error: Some local files have changes that conflict with the latest"
+                       echo "!!! revisions in the repository. Please contact their committer(s) to resolve"
+                       echo "!!! the conflicts manually before running sunrise-commit again:"
+                       for filename in $conflict_files ; do
+                               echo "!!!"
+                               echo "!!!        file: ${filename}"
+                               echo "!!!   committer: $(svn info ${filename} | sed -rn 's/Last Changed Author\: (.*)$/\1/p')"
+                       done
+                       exit 1
+               fi
        fi
        return ${1:-0}
 }