##// END OF EJS Templates
hgmerge: add and use ask_if_merged function...
Radoslaw Szkodzinski -
r1771:e22bbca2 default
parent child Browse files
Show More
@@ -70,6 +70,18 b' failure() {'
70 exit 1
70 exit 1
71 }
71 }
72
72
73 # Ask if the merge was successful
74 ask_if_merged() {
75 while 1; do
76 echo "$LOCAL seems unchanged. Was the merge successful? [y/n]"
77 read answer
78 case answer in
79 y*|Y*) success;;
80 n*|N*) failure;;
81 esac
82 done
83 }
84
73 # Clean up when interrupted
85 # Clean up when interrupted
74 trap "failure" 1 2 3 6 15 # HUP INT QUIT ABRT TERM
86 trap "failure" 1 2 3 6 15 # HUP INT QUIT ABRT TERM
75
87
@@ -98,16 +110,7 b' if [ -n "$FILEMERGE" ]; then'
98 # filemerge prefers the right by default
110 # filemerge prefers the right by default
99 $FILEMERGE -left "$OTHER" -right "$LOCAL" -ancestor "$BASE" -merge "$LOCAL"
111 $FILEMERGE -left "$OTHER" -right "$LOCAL" -ancestor "$BASE" -merge "$LOCAL"
100 [ $? -ne 0 ] && echo "FileMerge failed to launch" && failure
112 [ $? -ne 0 ] && echo "FileMerge failed to launch" && failure
101 if test "$LOCAL" -nt "$CHGTEST"
113 test "$LOCAL" -nt "$CHGTEST" && success || ask_if_merged
102 then
103 success
104 else
105 echo "$LOCAL seems unchanged. Was the merge successful?"
106 select answer in yes no
107 do
108 test "$answer" == "yes" && success || failure
109 done
110 fi
111 failure
114 failure
112 fi
115 fi
113
116
General Comments 0
You need to be logged in to leave comments. Login now