[PATCH 0/3] Permit directories ending in *.d or *.i

Matt Mackall mpm at selenic.com
Wed Jul 27 12:29:06 CDT 2005


On Thu, Jul 14, 2005 at 11:40:37PM +0200, Goffredo Baroncelli wrote:
> due to the internal repository architecture, mercurial doesn't allow
> the existence of directories ending in '.d' or '.i'. This patches
> change how mercurial stores the file under directories. In fact the
> file revlog of a file named 'a' is under '.hg/data/a.d' and
> '.hg/data/a.i'. So if we add a file under a directory named 'a.d'
> mercurial fails:

[catching up on my inbox, sorry for the delay]

I'd rather use an escaping scheme. Something likes:

def encodedir(dir):
    if dir.endswith(".d") or dir.endswith(".i") or dir.endswith(".hg"):
        dir += ".hg"
    return dir

def decodedir(dir):
    if dir.endswith(".hg"):
        dir = dir[:-3]
    return dir

I think this handles all the cases and should do so without breaking
existing repos.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list