[PATCH on-crew] patch._applydiff: normalize prefix . to empty string

Augie Fackler raf at durin42.com
Thu Mar 19 12:47:27 CDT 2015


On Thu, Mar 19, 2015 at 1:37 PM, Siddharth Agarwal <sid at less-broken.com> wrote:
> On 03/19/2015 10:31 AM, Augie Fackler wrote:
>> On Thu, Mar 19, 2015 at 10:19:53AM -0700, Siddharth Agarwal wrote:
>>> # HG changeset patch
>>> # User Siddharth Agarwal <sid0 at fb.com>
>>> # Date 1426785485 25200
>>> #      Thu Mar 19 10:18:05 2015 -0700
>>> # Node ID fbae66bb86e6f4433996e5787e276eb79299fc46
>>> # Parent  7262bbef2ba80ce3ccfc726a19c0e33a419aff04
>>> patch._applydiff: normalize prefix . to empty string
>> I'm a little conflicted about this. What if I'm sitting in dir/ and
>> say --prefix=.? Shouldn't that work out to --prefix=dir?
>
> At least in the current implementation, prefix is root-relative, not
> cwd-relative. I chose that because (a) import takes no other
> path-related arguments and (b) the paths import does take (via filenames
> in the patch) are root-relative.

Not sure it's consistent enough on the CLI.  'hg status .' is
$PWD-relative, which is the strongest non-changeset '.' association I
have for hg. I know I'd get surprised by a root-relative . here.


More information about the Mercurial-devel mailing list