[PATCH 1 of 2] vfs: add a 'reljoin' function for joining relative path

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Dec 16 11:02:38 CST 2014



On 12/16/2014 07:55 AM, Augie Fackler wrote:
> On Mon, Dec 15, 2014 at 01:48:56PM -0800, Pierre-Yves David wrote:
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david at fb.com>
>> # Date 1418678866 28800
>> #      Mon Dec 15 13:27:46 2014 -0800
>> # Node ID 85b532e6228482d7d7723827254fe01c7ea753cf
>> # Parent  495bc1b65d25872324a0220354f048b220304bd1
>> vfs: add a 'reljoin' function for joining relative path
>>
>> the 'vfs.join' method onlyh works for absolute path. We want something that
>> work for relative patch too when transforming file name. We want to avoid using
>> os.path.join because it may misbehave in some tricky encoding situation.
>
> It took me multiple readings to understand that the base vfs will use
> os.path.join, but that others may do their own logic. Perhaps it would
> be more clearly worded thus:
>
> The vfs.join method only works for absolute paths. We need something
> that works for relative paths too when transforming filenames. Since
> os.path.join may misbehave in tricky encoding situations, encapsulate
> the new join method in our vfs abstraction. The default implementation
> remains os.path.join, but this opens the door to other VFSes doing
> something more intelligent based on their needs.
>
> Is it okay if I queue with that paragraph instead of your paragraph?

Yes, you new paragraph is perfect.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list