Mercurial > hg
comparison hgmerge @ 1774:ac7b91bcbd8d
hgmerge: add meld support
author | Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl> |
---|---|
date | Tue, 21 Feb 2006 15:48:22 -0600 |
parents | aae93c3bffb4 |
children | 42f75cd04bf4 |
comparison
equal
deleted
inserted
replaced
1773:aae93c3bffb4 | 1774:ac7b91bcbd8d |
---|---|
32 | 32 |
33 # find optional visual utilities | 33 # find optional visual utilities |
34 FILEMERGE="/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge" | 34 FILEMERGE="/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge" |
35 KDIFF3="kdiff3" | 35 KDIFF3="kdiff3" |
36 TKDIFF="tkdiff" | 36 TKDIFF="tkdiff" |
37 MELD="meld" | |
37 | 38 |
38 type "$FILEMERGE" >/dev/null 2>&1 || FILEMERGE= | 39 type "$FILEMERGE" >/dev/null 2>&1 || FILEMERGE= |
39 type "$KDIFF3" >/dev/null 2>&1 || KDIFF3= | 40 type "$KDIFF3" >/dev/null 2>&1 || KDIFF3= |
40 type "$TKDIFF" >/dev/null 2>&1 || TKDIFF= | 41 type "$TKDIFF" >/dev/null 2>&1 || TKDIFF= |
42 type "$MELD" >/dev/null 2>&1 || MELD= | |
41 | 43 |
42 # random part of names | 44 # random part of names |
43 RAND="$RANDOM$RANDOM" | 45 RAND="$RANDOM$RANDOM" |
44 | 46 |
45 # temporary directory for diff+patch merge | 47 # temporary directory for diff+patch merge |
122 # try using tkdiff, which is a bit less sophisticated | 124 # try using tkdiff, which is a bit less sophisticated |
123 if [ -n "$TKDIFF" ]; then | 125 if [ -n "$TKDIFF" ]; then |
124 $TKDIFF "$LOCAL" "$OTHER" -a "$BASE" -o "$LOCAL" || failure | 126 $TKDIFF "$LOCAL" "$OTHER" -a "$BASE" -o "$LOCAL" || failure |
125 success | 127 success |
126 fi | 128 fi |
129 | |
130 if [ -n "$MELD" ]; then | |
131 cp "$BACKUP" "$CHGTEST" | |
132 # protect our feet - meld allows us to save to the left file | |
133 cp "$BACKUP" "$LOCAL.tmp.$RAND" | |
134 # Meld doesn't have automatic merging, so to reduce intervention | |
135 # use the file with conflicts | |
136 $MELD "$LOCAL.tmp.$RAND" "$LOCAL" "$OTHER" || failure | |
137 # Also it doesn't return good error code | |
138 test "$LOCAL" -nt "$CHGTEST" && success || ask_if_merged | |
139 fi | |
127 fi | 140 fi |
128 | 141 |
129 # Attempt to do a merge with $EDITOR | 142 # Attempt to do a merge with $EDITOR |
130 if [ -n "$MERGE" -o -n "$DIFF3" ]; then | 143 if [ -n "$MERGE" -o -n "$DIFF3" ]; then |
131 echo "conflicts detected in $LOCAL" | 144 echo "conflicts detected in $LOCAL" |
156 fi | 169 fi |
157 | 170 |
158 echo | 171 echo |
159 echo "hgmerge: unable to find any merge utility!" | 172 echo "hgmerge: unable to find any merge utility!" |
160 echo "supported programs:" | 173 echo "supported programs:" |
161 echo "merge, FileMerge, tkdiff, kdiff3, diff+patch" | 174 echo "merge, FileMerge, tkdiff, kdiff3, meld, diff+patch" |
162 echo | 175 echo |
163 failure | 176 failure |