Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hg-pull-mirror-test2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
heptapod
Testing Projects
hg-pull-mirror-test2
Commits
4338e33c
Commit
4338e33c
authored
19 years ago
by
Brendan Cully
Browse files
Options
Downloads
Patches
Plain Diff
Safer version of FileMerge merge
parent
d529cdc0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hgmerge
+31
-8
31 additions, 8 deletions
hgmerge
with
31 additions
and
8 deletions
hgmerge
+
31
−
8
View file @
4338e33c
...
@@ -44,14 +44,37 @@
...
@@ -44,14 +44,37 @@
cp
"
$LOCAL
.orig"
"
$LOCAL
"
cp
"
$LOCAL
.orig"
"
$LOCAL
"
fi
fi
# on MacOS X try opendiff
# on MacOS X try FileMerge.app, shipped with Apple's developer tools
# (uses FileMerge.app, shipped with Apple's developer tools)
# TODO: make proper temp files. foo.orig and foo.link are dangerous
if
type
opendiff
>
/dev/null 2>&1
;
then
FILEMERGE
=
'/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge'
opendiff
"
$LOCAL
.orig"
"
$OTHER
"
-ancestor
"
$BASE
"
-merge
"
$LOCAL
"
||
exit
1
if
type
"
$FILEMERGE
"
>
/dev/null 2>&1
;
then
# prevent $OTHER from being removed too early
cp
"
$LOCAL
.orig"
"
$LOCAL
"
# can surely be done in a more elegant way
ln
"
$LOCAL
"
"
$LOCAL
.link"
sleep
1
# filemerge prefers the right by default
exit
0
if
!
"
$FILEMERGE
"
-left
"
$OTHER
"
-right
"
$LOCAL
"
-ancestor
"
$BASE
"
-merge
"
$LOCAL
"
then
echo
"FileMerge failed to launch"
exit
1
fi
if
!
test
"
$LOCAL
"
-ef
"
$LOCAL
.link"
then
rm
"
$LOCAL
.orig"
"
$LOCAL
.link"
exit
0
else
rm
"
$LOCAL
.link"
echo
"
$LOCAL
is unchanged. Was the merge successful?"
select
answer
in
yes
no
do
if
test
"
$answer
"
==
"yes"
then
rm
"
$LOCAL
.orig"
exit
0
else
exit
1
fi
done
exit
1
fi
fi
fi
if
[
-n
"
$DISPLAY
"
]
;
then
if
[
-n
"
$DISPLAY
"
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment