HomePhabricator

patch: handle filenames with trailing spaces

Authored by spectral.

Description

patch: handle filenames with trailing spaces

I have no idea if this is *actually* supported by the patch file format, but at
least when reading from a patch file created by running hg shelve, it is
written out such that there's a trailing space after the second (b) filename.
When we read the patch file, we remove the space before parsing the filenames,
so it doesn't end up matching the other sources of what files are in the shelve.

We observed this internally due to a wrapper around unshelve that called into
patch.changedfiles, but hg patch is able to reproduce the issue as well, so
I've included both tests.

Differential Revision: https://phab.mercurial-scm.org/D9729

Details

Committed
spectralMon, Jan 11, 8:46 PM
Differential Revision
D9729: patch: handle filenames with trailing spaces
Parents
rHGdb2bc9e667a1: rust: fix testing with $TMPDIR ≠ /tmp
Branches
Unknown
Tags
Unknown