durin42 / hg-git

fork of hg-git

No description has been added.

Clone this repository (size: 465.0 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/durin42/hg-git/
commit 263: 9f5a7a5d52aa
parent 262: fdb8065e2eac
branch: default
Enable detection of bare repositories as a local git repo
Lincoln Stoll / lstoll
5 months ago

Changed (Δ269 bytes):

raw changeset »

hggit/__init__.py (6 lines added, 0 lines removed)

Up to file-list hggit/__init__.py:

@@ -36,6 +36,12 @@ def _local(path):
36
36
    if (os.path.exists(os.path.join(p, '.git')) and 
37
37
        not os.path.exists(os.path.join(p, '.hg'))):
38
38
        return gitrepo
39
    # detect a bare repository
40
    if (os.path.exists(os.path.join(p, 'HEAD')) and 
41
        os.path.exists(os.path.join(p, 'objects')) and 
42
        os.path.exists(os.path.join(p, 'refs')) and 
43
        not os.path.exists(os.path.join(p, '.hg'))):
44
        return gitrepo
39
45
    return _oldlocal(path)
40
46
41
47
hg.schemes['file'] = _local