/!\ This page is primarily intended for Mercurial's developers.

Path separator handling

How Mercurial handles path separators

1. Overview

This page is intended to collect information about Mercurial's current path separator behavior and help formulate coherent rules for when paths should be converted.

2. Basics

There are three basic path formats:

OS-specific observations:

Basic rules:

APIs:

3. Audit of current usage

As of Mercurial 2.4, we have the following behavior:

command

output

ui.slash

comments

hg add/copy/forget/rename/remove/revert

local

no

hg diff/export

portable

hg locate

portable

unusual for working directory command

hg manifest

portable

hg log

portable

hg resolve

portable

unusual for working directory command

hg status

local

yes

even if not checking working directory

hg clone/push/pull/in/out

local

no

shows normalized source

hg rebase/strip

local

no

reports path of backup bundle

Inferred rules:

4. Tests

As of 2.4, the Mercurial test suite uses the '(glob)' filter to hide Windows-specific path changes (and ui.slash=on). This has several downsides:

Some possible improvements:

Questions related to Tests:

5. Questions

6. Notes


  1. Exceptions see above (1)

PathSeparator (last edited 2013-07-15 09:10:42 by SimonHeimberg)