Temporary Symlinks created in repos

Alexis S. L. Carvalho alexis at cecm.usp.br
Fri Aug 17 22:09:28 CDT 2007


Thus spake Gabriel Dragffy:
> Hi all
> 
> I've recently started using Mercurial. I have a repository stored on  
> a G5 and mount the drive it's on using AFP. After a couple of push/ 
> pull operations to/from it it seems to have some temporary entities  
> appearing.
> 
> At the moment a directory listing will show the following (amongst  
> the other things):
> lrwxr-xr-x    1 gabriel  gabriel     1 Aug 11 20:57 tmpKbEjOj -> .
> lrwxr-xr-x    1 gabriel  gabriel     1 Aug 11 21:36 tmpWQKOiT -> .
> lrwxr-xr-x    1 gabriel  gabriel     1 Aug 11 21:42 tmpZ-Ko-c -> .
> 
> I have read the tutorials and guides, but saw no mention of these.  
> They're a little annoying because hg st is showing them as ?. Other  
> repositories that have been cloned from this one don't seem to  
> accumulate these symlinks. I'd be glad of any help.

Mercurial creates these temporary symlinks to detect if the filesystem
supports symlinks, but they should have been removed right after their
creation[1]...

Maybe there's some oddity in the way your filesystem handles symlinks?
"lrwxr-xr-x" is not a very common mode for them...

Alexis

[1] - the relevant code is:

def checklink(path):
    """check whether the given path is on a symlink-capable filesystem"""
    # mktemp is not racy because symlink creation will fail if the
    # file already exists
    name = tempfile.mktemp(dir=path)
    try:
        os.symlink(".", name)
        os.unlink(name)
        return True
    except (OSError, AttributeError):
        return False


More information about the Mercurial mailing list