felipec / git-remote-hg

Transparent bidirectional bridge between Git and Mercurial for Git
GNU General Public License v2.0
369 stars 87 forks source link

Error when cloning a repo: Cannot lock ref... #46

Closed burjui closed 9 years ago

burjui commented 9 years ago

Recently git-remote-hg started giving an error when I was pulling from our corporate Mercurial repo. I did not update git-remote-hg nor Mercurial, it seems to be a git-remote-hg's issue with our repo. When I tried clone the repo to start with a clean one, I got the same error:

Cloning into 'android_framework'... requesting all changes adding changesets adding manifests adding file changes added 1674 changesets with 7397 changes to 2720 files (+2 heads) progress revision 99 'master' (100/1613) progress revision 199 'master' (200/1613) progress revision 299 'master' (300/1613) progress revision 399 'master' (400/1613) progress revision 499 'master' (500/1613) progress revision 599 'master' (600/1613) progress revision 699 'master' (700/1613) progress revision 799 'master' (800/1613) progress revision 899 'master' (900/1613) progress revision 999 'master' (1000/1613) progress revision 1099 'master' (1100/1613) progress revision 1199 'master' (1200/1613) progress revision 1299 'master' (1300/1613) progress revision 1399 'master' (1400/1613) progress revision 1599 'freestyle' (1600/1649) error: Cannot lock ref 'refs/hg/origin/tags/Bitrix24/Release/3.1': 'refs/hg/origin/tags/Bitrix24/Release/3.1/270' exists; cannot create 'refs/hg/origin/tags/Bitrix24/Release/3.1' fatal: Error while running fast-import Traceback (most recent call last):
File "/usr/bin/git-remote-hg", line 1322, in sys.exit(main(sys.argv)) File "/usr/bin/git-remote-hg", line 1315, in main marks.store() File "/usr/bin/git-remote-hg", line 167, in store json.dump(self.dict(), open(self.path, 'w')) IOError: [Errno 2] No such file or directory: '/home/burjui/tmp/android_framework/.git/hg/origin/marks-hg'

I'm not sure if I can provide access to our corporate repo, but I can help debug stuff.

felipec commented 8 years ago

Is this not an issue any more?

vladimirfx commented 8 years ago

Same issue for me:

requesting all changes adding changesets adding manifests adding file changes added 6795 changesets with 29351 changes to 3206 files (+18 heads) progress revision 99 'master' (100/6014) progress revision 199 'master' (200/6014) progress revision 299 'master' (300/6014) progress revision 399 'master' (400/6014) progress revision 499 'master' (500/6014) progress revision 599 'master' (600/6014) progress revision 699 'master' (700/6014) progress revision 799 'master' (800/6014) progress revision 899 'master' (900/6014) progress revision 999 'master' (1000/6014) progress revision 1099 'master' (1100/6014) progress revision 1199 'master' (1200/6014) progress revision 1299 'master' (1300/6014) progress revision 1399 'master' (1400/6014) progress revision 1499 'master' (1500/6014) progress revision 1599 'master' (1600/6014) progress revision 1699 'master' (1700/6014) progress revision 1799 'master' (1800/6014) progress revision 1899 'master' (1900/6014) progress revision 1999 'master' (2000/6014) progress revision 2099 'master' (2100/6014) progress revision 2199 'master' (2200/6014) progress revision 2399 'master' (2400/6014) progress revision 2499 'master' (2500/6014) progress revision 2599 'master' (2600/6014) progress revision 2699 'master' (2700/6014) progress revision 2799 'master' (2800/6014) progress revision 2899 'master' (2900/6014) progress revision 3099 'master' (3100/6014) progress revision 3199 'master' (3200/6014) progress revision 3299 'master' (3300/6014) progress revision 3399 'master' (3400/6014) progress revision 3499 'master' (3500/6014) progress revision 3599 'master' (3600/6014) progress revision 3699 'master' (3700/6014) progress revision 3799 'master' (3800/6014) progress revision 3899 'master' (3900/6014) progress revision 3999 'master' (4000/6014) progress revision 4099 'master' (4100/6014) progress revision 4199 'master' (4200/6014) progress revision 4299 'master' (4300/6014) progress revision 4399 'master' (4400/6014) progress revision 4499 'master' (4500/6014) progress revision 4599 'master' (4600/6014) progress revision 4699 'master' (4700/6014) progress revision 4799 'master' (4800/6014) progress revision 4899 'master' (4900/6014) progress revision 4999 'master' (5000/6014) progress revision 5099 'master' (5100/6014) progress revision 5299 'master' (5300/6014) progress revision 5399 'master' (5400/6014) progress revision 5499 'master' (5500/6014) progress revision 5599 'master' (5600/6014) progress revision 5699 'master' (5700/6014) progress revision 5799 'master' (5800/6014) progress revision 5899 'master' (5900/6014) progress revision 5999 'master' (6000/6014) progress revision 6099 'master' (6100/6014) progress revision 6199 'master' (6200/6014) progress revision 6299 'master' (6300/6014) progress revision 6499 'master' (6500/6014) progress revision 6599 'master' (6600/6014) progress revision 6699 'support/5' (6700/6036) progress revision 6399 'feature/11974' (6400/6057) progress revision 2299 'feature/6375' (2300/4198) error: cannot lock ref 'refs/hg/origin/branches/support/5/12317': 'refs/hg/origin/branches/support/5' exists; cannot create 'refs/hg/origin/branches/support/5/12317' error: cannot lock ref 'refs/hg/origin/branches/release/6/12163': 'refs/hg/origin/branches/release/6' exists; cannot create 'refs/hg/origin/branches/release/6/12163' error: cannot lock ref 'refs/hg/origin/branches/support/5/7978': 'refs/hg/origin/branches/support/5' exists; cannot create 'refs/hg/origin/branches/support/5/7978' error: cannot lock ref 'refs/hg/origin/branches/support/5/12361': 'refs/hg/origin/branches/support/5' exists; cannot create 'refs/hg/origin/branches/support/5/12361' error: cannot lock ref 'refs/hg/origin/branches/support/5/12373': 'refs/hg/origin/branches/support/5' exists; cannot create 'refs/hg/origin/branches/support/5/12373' error: cannot lock ref 'refs/hg/origin/branches/release/6/11113': 'refs/hg/origin/branches/release/6' exists; cannot create 'refs/hg/origin/branches/release/6/11113' error: cannot lock ref 'refs/hg/origin/branches/support/5/11772': 'refs/hg/origin/branches/support/5' exists; cannot create 'refs/hg/origin/branches/support/5/11772' error: cannot lock ref 'refs/hg/origin/branches/release/6/12375': 'refs/hg/origin/branches/release/6' exists; cannot create 'refs/hg/origin/branches/release/6/12375' fatal: Error while running fast-import Traceback (most recent call last): File "/usr/local/bin/git-remote-hg", line 1356, in sys.exit(main(sys.argv)) File "/usr/local/bin/git-remote-hg", line 1349, in main marks.store() File "/usr/local/bin/git-remote-hg", line 167, in store json.dump(self.dict(), open(self.path, 'w')) IOError: [Errno 2] No such file or directory: '/Users/vladimirfx/dev/projects/yodha/yodha-backend-git/.git/hg/origin/marks-hg'

vladimirfx commented 8 years ago

iMac-Vladimir:yodha vladimirfx$ git --version git version 2.8.2

iMac-Vladimir:yodha vladimirfx$ hg --version Mercurial Distributed SCM (version 3.3)

felipec commented 8 years ago

The problem is the names of the branches: in Git you cannot have both 'branches/support/5/12317' and 'branches/support/5', because it uses directories for those.

vladimirfx commented 8 years ago

OK... That branch structure result of HGFlow usage. Same tool exists for Git and works in very similar manner... I wonder why GitFlow does not have this kind of problems. If I 'fix' my current branch structure, does closed branches affect conversion process?

felipec commented 8 years ago

Maybe GitFlow uses slightly different names. Yeah, the closed branches are ignored.