equal
deleted
inserted
replaced
68 mv "$BACKUP" "$LOCAL" |
68 mv "$BACKUP" "$LOCAL" |
69 cleanup |
69 cleanup |
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 |
76 # Back up our file (and try hard to keep the mtime unchanged) |
88 # Back up our file (and try hard to keep the mtime unchanged) |
77 mv "$LOCAL" "$BACKUP" |
89 mv "$LOCAL" "$BACKUP" |
96 cp "$BACKUP" "$LOCAL" |
108 cp "$BACKUP" "$LOCAL" |
97 cp "$BACKUP" "$CHGTEST" |
109 cp "$BACKUP" "$CHGTEST" |
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 |
114 if [ -n "$DISPLAY" ]; then |
117 if [ -n "$DISPLAY" ]; then |
115 # try using kdiff3, which is fairly nice |
118 # try using kdiff3, which is fairly nice |