Page MenuHomePhabricator

patch: stop aborting when add/rename/copy files on --interactive (issue5727)
Needs ReviewPublic

Authored by navaneeth.suresh on Mar 3 2019, 2:24 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

issue5727 was reported specifically for mq on using qrefresh. On investigating further,
I realized that it was a check in patch.py that resulting in the abort. I may be wrong.
On interactive mode, gp.mode was not None. I added a check in _applydiff() not to
abort when gp.mode is None or ui.interactive is True.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

navaneeth.suresh retitled this revision from patch: stop aborting when ADD/RENAME/COPY files on --interactive (issue5727) to patch: stop aborting when add/rename/copy files on --interactive (issue5727).Mar 14 2019, 2:21 AM
navaneeth.suresh updated this revision to Diff 14492.
pulkit added a subscriber: pulkit.Mar 15 2019, 9:39 AM
pulkit added inline comments.
tests/test-mq-qrefresh.t
570

does this prompt ended here? it didn't show changes in 'foo.h'?

tests/test-mq-qrefresh.t
570

i think that's usual here as the file foo.h is empty. i have the following case running successfully with this patch:

$ echo foo > foo.h
$ hg add foo.h
$ hg qrefresh -i --config ui.interactive=true <<EOF
> y
> y
> n
> EOF
diff --git a/foo.h b/foo.h
new file mode 100644
examine changes to 'foo.h'? [Ynesfdaq?] y

@@ -0,0 +1,1 @@
+foo
record this change to 'foo.h'? [Ynesfdaq?] y
pulkit added inline comments.Mar 16 2019, 7:01 PM
tests/test-mq-qrefresh.t
570

I don't see the output which asks for record this change to foo.h here in the test.

tests/test-mq-qrefresh.t
570

IIUC, the current scenario is running into abort: cannot create foo.h: destination already exists if an empty file has been added. This means that the test case in my previous comment works fine without running into an error. I tested with hg (version 4.9+3-b70b7c585ee9) by adding a file with contents by running one command after another in my command line and got the same output. The interactive UI prompted me with only two queries. For an empty file, it should be only one as there are no changes to record. This might be the case for qrefresh. I'm not sure about this though.

Gentle ping for review.

This patch breaks test-split.t - could you take a look?