commit - c9a4f4fa65c4e3f4457190460a0b3ec4c50c8d4d
commit + 762b8e82159007814bc0eaacebf8c2ff2ad34cb5
blob - 9d65d8aa6b3211dfb9e231199f0bc3e522f4dfa8
blob + 6e54669dd487e962e60aabbc77043a09b250bd99
--- got/got.1
+++ got/got.1
Show the status of each affected file, using the following status codes:
.Bl -column XYZ description
.It M Ta file was modified
+.It G Ta file was merged using a merge-base found in the repository
+.It C Ta file was merged and conflicts occurred during merge
.It D Ta file was deleted
.It A Ta file was added
.It # Ta failed to patch the file
blob - 6f6b8fb3d771e42ab874179bfc9aa6defacadbef
blob + 9dccdc479c87919f89cf0a8b01fb1f3ab5b367ca
--- lib/patch.c
+++ lib/patch.c
unlink(newpath);
} else if (*overlapcnt != 0)
err = report_progress(pa, old, new, GOT_STATUS_CONFLICT, NULL);
+ else if (do_merge)
+ err = report_progress(pa, old, new, GOT_STATUS_MERGE, NULL);
else
err = report_progress(pa, old, new, GOT_STATUS_MODIFY, NULL);
blob - 5d79b58c66cb3e7160cfdb8ce13e13901219e70e
blob + 9fb1dd39304f1cd716283dd5684a1162ee8f745c
--- regress/cmdline/patch.sh
+++ regress/cmdline/patch.sh
fi
(cd $testroot/wt && got patch $testroot/old.diff) \
- 2>&1 > /dev/null
+ > $testroot/stdout
ret=$?
if [ $ret -ne 0 ]; then
test_done $testroot $ret
return 1
fi
+ echo 'G numbers' > $testroot/stdout.expected
+ cmp -s $testroot/stdout $testroot/stdout.expected
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ diff -u $testroot/stdout $testroot/stdout.expected
+ test_done $testroot $ret
+ return 1
+ fi
+
jot 10 | sed -e s/4/four/ -e s/6/six/ > $testroot/wt/numbers.expected
cmp -s $testroot/wt/numbers $testroot/wt/numbers.expected
ret=$?
fi
(cd $testroot/wt && got patch $testroot/old.diff) \
- >/dev/null 2>&1
+ > $testroot/stdout 2>/dev/null
ret=$?
if [ $ret -eq 0 ]; then
echo "got patch merged a diff that should conflict" >&2
return 1
fi
+ echo 'C numbers' > $testroot/stdout.expected
+ cmp -s $testroot/stdout $testroot/stdout.expected
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ diff -u $testroot/stdout $testroot/stdout.expected
+ test_done $testroot $ret
+ return 1
+ fi
+
# XXX: prefixing every line with a tab otherwise got thinks
# the file has conflicts in it.
cat <<-EOF > $testroot/wt/numbers.expected