Show More
@@ -20,36 +20,24 b' cp "$LOCAL" "$LOCAL.orig"' | |||||
20 |
|
20 | |||
21 | # Attempt to do a non-interactive merge |
|
21 | # Attempt to do a non-interactive merge | |
22 | if type merge > /dev/null 2>&1; then |
|
22 | if type merge > /dev/null 2>&1; then | |
23 |
|
|
23 | merge "$LOCAL" "$BASE" "$OTHER" 2> /dev/null && exit 0 | |
24 | # success! |
|
|||
25 | exit 0 |
|
|||
26 | fi |
|
|||
27 | cp "$LOCAL.orig" "$LOCAL" |
|
24 | cp "$LOCAL.orig" "$LOCAL" | |
28 | elif type diff3 > /dev/null 2>&1; then |
|
25 | elif type diff3 > /dev/null 2>&1; then | |
29 |
|
|
26 | diff3 -m "$LOCAL.orig" "$BASE" "$OTHER" > "$LOCAL" && exit 0 | |
30 | # success |
|
|||
31 | exit 0 |
|
|||
32 | fi |
|
|||
33 | cp "$LOCAL.orig" "$LOCAL" |
|
27 | cp "$LOCAL.orig" "$LOCAL" | |
34 | fi |
|
28 | fi | |
35 |
|
29 | |||
36 | if [ -n "$DISPLAY" ]; then |
|
30 | if [ -n "$DISPLAY" ]; then | |
37 | # try using kdiff3, which is fairly nice |
|
31 | # try using kdiff3, which is fairly nice | |
38 | if type kdiff3 > /dev/null 2>&1; then |
|
32 | if type kdiff3 > /dev/null 2>&1; then | |
39 |
|
|
33 | kdiff3 --auto "$BASE" "$LOCAL" "$OTHER" -o "$LOCAL" || exit 1 | |
40 |
|
|
34 | exit 0 | |
41 | else |
|
|||
42 | exit 1 |
|
|||
43 | fi |
|
|||
44 | fi |
|
35 | fi | |
45 |
|
36 | |||
46 | # try using tkdiff, which is a bit less sophisticated |
|
37 | # try using tkdiff, which is a bit less sophisticated | |
47 | if type tkdiff > /dev/null 2>&1; then |
|
38 | if type tkdiff > /dev/null 2>&1; then | |
48 |
|
|
39 | tkdiff "$LOCAL" "$OTHER" -a "$BASE" -o "$LOCAL" || exit 1 | |
49 |
|
|
40 | exit 0 | |
50 | else |
|
|||
51 | exit 1 |
|
|||
52 | fi |
|
|||
53 | fi |
|
41 | fi | |
54 | fi |
|
42 | fi | |
55 |
|
43 | |||
@@ -73,8 +61,7 b' cleanup_exit() {' | |||||
73 | } |
|
61 | } | |
74 |
|
62 | |||
75 | # attempt to manually merge with diff and patch |
|
63 | # attempt to manually merge with diff and patch | |
76 | if type diff > /dev/null 2>&1; then |
|
64 | if type diff > /dev/null 2>&1 && type patch > /dev/null 2>&1; then | |
77 | if type patch > /dev/null 2>&1; then |
|
|||
78 |
|
|
65 | # Remove temporary files even if we get interrupted | |
79 |
|
|
66 | trap "cleanup_exit 1" TERM KILL INT QUIT ABRT | |
80 |
|
67 | |||
@@ -92,7 +79,6 b' if type diff > /dev/null 2>&1; then' | |||||
92 | fi |
|
79 | fi | |
93 |
|
|
80 | cleanup_exit 1 | |
94 | fi |
|
81 | fi | |
95 | fi |
|
|||
96 |
|
82 | |||
97 | echo "hgmerge: unable to find merge, tkdiff, kdiff3, or diff+patch!" |
|
83 | echo "hgmerge: unable to find merge, tkdiff, kdiff3, or diff+patch!" | |
98 | exit 1 |
|
84 | exit 1 |
General Comments 0
You need to be logged in to leave comments.
Login now