commit - 726fb9002b2e7771cda3f3d5cc94684cc6369949
commit + 0ef688596bd8c81c1cf6abdee7aedc07e1cbcbbc
blob - 9a7c3707d0e886caa6b6f3d804a1a632c1c0577e
blob + 4243f23b50091364bbf6e6385566ba2a1d0e3cb9
--- got/got.c
+++ got/got.c
int obstructed;
int not_updated;
int missing;
+ int not_deleted;
+ int unversioned;
int verbosity;
};
"conflicts: %d\n", upa->not_updated);
}
+/*
+ * The meaning of some status codes differs between merge-style operations and
+ * update operations. For example, the ! status code means "file was missing"
+ * if changes were merged into the work tree, and "missing file was restored"
+ * if the work tree was updated. This function should be used by any operation
+ * which merges changes into the work tree without updating the work tree.
+ */
+void
+print_merge_progress_stats(struct got_update_progress_arg *upa)
+{
+ if (!upa->did_something)
+ return;
+
+ if (upa->conflicts > 0)
+ printf("Files with new merge conflicts: %d\n", upa->conflicts);
+ if (upa->obstructed > 0)
+ printf("File paths obstructed by a non-regular file: %d\n",
+ upa->obstructed);
+ if (upa->missing > 0)
+ printf("Files which had incoming changes but could not be "
+ "found in the work tree: %d\n", upa->missing);
+ if (upa->not_deleted > 0)
+ printf("Files not deleted due to differences in deleted "
+ "content: %d\n", upa->not_deleted);
+ if (upa->unversioned > 0)
+ printf("Files not merged because an unversioned file was "
+ "found in the work tree: %d\n", upa->unversioned);
+}
+
__dead static void
usage_update(void)
{
upa->not_updated++;
if (status == GOT_STATUS_MISSING)
upa->missing++;
+ if (status == GOT_STATUS_CANNOT_DELETE)
+ upa->not_deleted++;
+ if (status == GOT_STATUS_UNVERSIONED)
+ upa->unversioned++;
while (path[0] == '/')
path++;
if (upa.did_something)
printf("Merged commit %s\n", commit_id_str);
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
done:
if (commit)
got_object_commit_close(commit);
if (upa.did_something)
printf("Backed out commit %s\n", commit_id_str);
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
done:
if (commit)
got_object_commit_close(commit);
if (error)
goto done;
printf("Rebase of %s aborted\n", got_ref_get_name(branch));
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
goto done; /* nothing else to do */
}
goto done;
printf("Rebase of %s aborted\n",
got_ref_get_name(branch));
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
}
error = got_error(GOT_ERR_EMPTY_REBASE);
if (error)
goto done;
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
if (upa.conflicts > 0)
rebase_status = GOT_STATUS_CONFLICT;
goto done;
printf("Histedit of %s aborted\n",
got_ref_get_symref_target(branch));
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
goto done; /* nothing else to do */
} else if (abort_edit) {
error = got_error(GOT_ERR_NOT_HISTEDIT);
got_worktree_histedit_abort(worktree, fileindex,
repo, branch, base_commit_id,
update_progress, &upa);
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
goto done;
}
} else {
got_worktree_histedit_abort(worktree, fileindex,
repo, branch, base_commit_id,
update_progress, &upa);
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
goto done;
}
got_worktree_histedit_abort(worktree, fileindex,
repo, branch, base_commit_id,
update_progress, &upa);
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
goto done;
}
got_object_commit_close(commit);
commit = NULL;
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
if (upa.conflicts > 0)
rebase_status = GOT_STATUS_CONFLICT;
check_cancelled, NULL);
if (error)
goto done;
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
if (!upa.did_something) {
error = got_worktree_merge_abort(worktree, fileindex,
repo, update_progress, &upa);
error = got_worktree_unstage(worktree, &paths, update_progress,
&upa, pflag ? choose_patch : NULL, &cpa, repo);
if (!error)
- print_update_progress_stats(&upa);
+ print_merge_progress_stats(&upa);
done:
if (patch_script_file && fclose(patch_script_file) == EOF &&
error == NULL)
blob - 219e1fb124feebc4ea8b077b5fbe2cc78e072f34
blob + 548dac7cec6a0bef830836a1220db040da604b7e
--- regress/cmdline/backout.sh
+++ regress/cmdline/backout.sh
echo "! alpha" > $testroot/stdout.expected
echo "Backed out commit $bad_commit" >> $testroot/stdout.expected
+ echo -n "Files which had incoming changes but could not be found " \
+ >> $testroot/stdout.expected
+ echo "in the work tree: 1" >> $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
echo "G epsilon/zeta" >> $testroot/stdout.expected
echo "! new" >> $testroot/stdout.expected
echo "Backed out commit $bad_commit" >> $testroot/stdout.expected
+ echo -n "Files which had incoming changes but could not be found " \
+ >> $testroot/stdout.expected
+ echo "in the work tree: 1" >> $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
blob - b83c96c06f1e72e3b6208710f2b7a15bd572ae1f
blob + f231cd39fabd9b35e18d1a94dd8af5b2c6f2c86f
--- regress/cmdline/cherrypick.sh
+++ regress/cmdline/cherrypick.sh
echo "C new.link" >> $testroot/stdout.expected
echo "Merged commit $commit_id2" >> $testroot/stdout.expected
echo "Files with new merge conflicts: 6" >> $testroot/stdout.expected
+ echo -n "Files which had incoming changes but could not be found " \
+ >> $testroot/stdout.expected
+ echo "in the work tree: 1" >> $testroot/stdout.expected
+ echo -n "Files not merged because an unversioned file was found in " \
+ >> $testroot/stdout.expected
+ echo "the work tree: 1" >> $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
echo "! beta" >> $testroot/stdout.expected
echo "G epsilon/new" >> $testroot/stdout.expected
echo "Merged commit $branch_rev" >> $testroot/stdout.expected
+ echo -n "Files which had incoming changes but could not be found " \
+ >> $testroot/stdout.expected
+ echo "in the work tree: 1" >> $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
blob - d4e0cb2db7f4ccaf1b56d880da1adfd94b2707d6
blob + 9ccf58a99fdd79c9cbff150bd8b95494b4706cd0
--- regress/cmdline/merge.sh
+++ regress/cmdline/merge.sh
echo "! alpha" > $testroot/stdout.expected
echo "G gamma/delta" >> $testroot/stdout.expected
+ echo -n "Files which had incoming changes but could not be found " \
+ >> $testroot/stdout.expected
+ echo "in the work tree: 1" >> $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
blob - fb0d3cf6ab0733385d8d9b463c46f77f5bdbc294
blob + 14c4abae4bf327f96937f9c2ad442aaf638bce8e
--- regress/cmdline/rebase.sh
+++ regress/cmdline/rebase.sh
echo ": committing to delta on newbranch" >> $testroot/stdout.expected
echo "! beta" >> $testroot/stdout.expected
echo "! d/f/g/new" >> $testroot/stdout.expected
+ echo -n "Files which had incoming changes but could not be found " \
+ >> $testroot/stdout.expected
+ echo "in the work tree: 2" >> $testroot/stdout.expected
echo -n "$short_orig_commit2 -> no-op change" \
>> $testroot/stdout.expected
echo ": removing beta and d/f/g/new on newbranch" \