Closed Bug 1671842 Opened 4 years ago Closed 4 years ago

`moz-phab patch` fails for patch containing a rename

Categories

(Conduit :: moz-phab, defect)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: botond, Unassigned)

Details

Attachments

(1 file)

STR

  1. Check out recent m-c, such as revision 3a9fcbf00f37.
  2. Run moz-phab patch --apply-to here D93895. Note that D93895 includes two file renames, and the original files are present in 3a9fcbf00f37.

Expected results

The patch is applied, including the files being renamed.

Actual results

I get an error related to one of the renames:

$ moz-phab patch --apply-to here D93895
Patching revision: D93895
Bookmark set to phab-D93895_1
abort: gfx/layers/apz/test/mochitest/helper_scrollframe_activation_on_load.html (renamed from gfx/layers/apz/test/mochitest/helper_bug1151663.html): No such file or directory
CommandError: command 'hg' failed to complete successfully
Run moz-phab again with '--trace' to show debugging output
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit

I attached the output of the same command with --trace.

Summary: `moz-phab patch` fails if patch contains a rename → `moz-phab patch` fails for patch containing a rename

I've been unable to reproduce this issue:

$ hg st
$ hg id
3a9fcbf00f37
$ moz-phab patch --apply-to here D93895
Patching revision: D93895
Bookmark set to phab-D93895
D93895 applied

The command that moz-phab runs is essentially hg import https://d3kxowhw4s8amj.cloudfront.net/file/data/vlh3abde5dzontwetpu2/PHID-FILE-jrrshrike6w5atlvsnpi/D93895.diff.

Thanks for attaching the debug log - I see from that you're running an old version of Mercurial (5.1); are you able to update to the latest version (5.5.2) and try again? While I don't see anything in the changelog that might have addressed this, it's a simple first place to start.

Flags: needinfo?(botond)

(In reply to :glob 🎈 from comment #1)

The command that moz-phab runs is essentially hg import https://d3kxowhw4s8amj.cloudfront.net/file/data/vlh3abde5dzontwetpu2/PHID-FILE-jrrshrike6w5atlvsnpi/D93895.diff.

I can confirm that running this command in isolation produces the same error, so I guess this is an issue on the mercurial side rather than in moz-phab.

Thanks for attaching the debug log - I see from that you're running an old version of Mercurial (5.1); are you able to update to the latest version (5.5.2) and try again? While I don't see anything in the changelog that might have addressed this, it's a simple first place to start.

After upgrading mercurial, the behaviour for me is the same.

Flags: needinfo?(botond)

Prefixing the command with HGRCPATH= makes it succeed, suggesting that it's something in my .hgrc that's messing things up.

It seems to be this option:

[ui]
patch = patch --merge

which IIRC is something I've added to get hg import to produce conflict markers rather than .rej files in case of a merge conflict.

Perhaps that's expected, or perhaps I should file a mercurial bug about this. Anyways, it doesn't seem to be a moz-phab issue so I'll close this bug.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: