[PATCH 3 of 8] match: add the abs() method

Matt Mackall mpm at selenic.com
Tue Dec 23 16:01:25 CST 2014


On Tue, 2014-12-23 at 15:56 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1417223746 18000
> #      Fri Nov 28 20:15:46 2014 -0500
> # Node ID aa5998c14c5c8407869cc728e41940130e390ba3
> # Parent  04de3b9ae56e98740c83ee342b68d735b7e9ec73
> match: add the abs() method
> 
> This is a utility to make it easier for subrepos to convert a file name to the
> full path rooted at the top repository.  It can replace the various path joining
> lambdas, and doesn't require the prefix to be passed into the method that wishes
> to build such a path.  It will also allow making the manner in which absolute
> subrepo paths are displayed on Windows consistent with the way absolute repo
> paths are- i.e. with '/' as the separator, instead of the current mix of '\'
> and '/'.

This is not ideal. First, we _really_ need to stop using os methods in
core code, especially in furtherance of anything related to Windows:

http://mercurial.selenic.com/wiki/WindowsUTF8Plan

Second, the matcher currently doesn't use os at all, which should be an
alarm bell: it's intentionally completely OS-agnostic at present. This
is important because it's used against both working copy and in-history
paths.

I like the idea of this abs() method, but trying to solve cross-OS slash
issues at the same time as you introduce it is tying a very heavy boat
anchor to it.

Also, queuebot sends its regards.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list