alanbian / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

Failure on repo init requires rm -rf .repo #73

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Affected Version: 1.6.10.2
Environment: linux

What steps will reproduce the problem?
1.  Run repo init with a bad url
2.  Rerun repo init with the correct url

What is the expected output? What do you see instead?
Repo fails with 
IOError: [Errno 2] No such file or directory: 
'/home/kliegs/repo_test/.repo/manifests/.git/HEAD'

Please provide any additional information below.
kliegs@kliegs-chrome:~/repo_test$ repo init -u 
http://src.chromium.org/git/manifestz -m minilayout.xml
Getting repo ...
   from http://android.git.kernel.org/tools/repo.git
remote: Counting objects: 1090, done.
remote: Compressing objects: 100% (464/464), done.
remote: Total 1090 (delta 684), reused 990 (delta 605)
Receiving objects: 100% (1090/1090), 310.75 KiB | 411 KiB/s, done.
Resolving deltas: 100% (684/684), done.
From http://android.git.kernel.org/tools/repo
 * [new branch]      maint      -> origin/maint
 * [new branch]      master     -> origin/master
 * [new branch]      stable     -> origin/stable
 * [new tag]         v1.6.10.2  -> v1.6.10.2
From http://android.git.kernel.org/tools/repo
 * [new tag]         v1.0       -> v1.0
 * [new tag]         v1.0.1     -> v1.0.1
 * [new tag]         v1.0.2     -> v1.0.2
 * [new tag]         v1.0.3     -> v1.0.3
 * [new tag]         v1.0.4     -> v1.0.4
 * [new tag]         v1.0.5     -> v1.0.5
 * [new tag]         v1.0.6     -> v1.0.6
 * [new tag]         v1.0.7     -> v1.0.7
 * [new tag]         v1.0.8     -> v1.0.8
 * [new tag]         v1.0.9     -> v1.0.9
 * [new tag]         v1.1       -> v1.1
 * [new tag]         v1.2       -> v1.2
 * [new tag]         v1.3       -> v1.3
 * [new tag]         v1.3.1     -> v1.3.1
 * [new tag]         v1.3.2     -> v1.3.2
 * [new tag]         v1.4       -> v1.4
 * [new tag]         v1.4.1     -> v1.4.1
 * [new tag]         v1.4.2     -> v1.4.2
 * [new tag]         v1.4.3     -> v1.4.3
 * [new tag]         v1.4.4     -> v1.4.4
 * [new tag]         v1.5       -> v1.5
 * [new tag]         v1.5.1     -> v1.5.1
 * [new tag]         v1.6       -> v1.6
 * [new tag]         v1.6.1     -> v1.6.1
 * [new tag]         v1.6.10    -> v1.6.10
 * [new tag]         v1.6.10.1  -> v1.6.10.1
 * [new tag]         v1.6.2     -> v1.6.2
 * [new tag]         v1.6.3     -> v1.6.3
 * [new tag]         v1.6.4     -> v1.6.4
 * [new tag]         v1.6.5     -> v1.6.5
 * [new tag]         v1.6.6     -> v1.6.6
 * [new tag]         v1.6.7     -> v1.6.7
 * [new tag]         v1.6.7.1   -> v1.6.7.1
 * [new tag]         v1.6.7.2   -> v1.6.7.2
 * [new tag]         v1.6.7.3   -> v1.6.7.3
 * [new tag]         v1.6.7.4   -> v1.6.7.4
 * [new tag]         v1.6.7.5   -> v1.6.7.5
 * [new tag]         v1.6.8     -> v1.6.8
 * [new tag]         v1.6.8.1   -> v1.6.8.1
 * [new tag]         v1.6.8.10  -> v1.6.8.10
 * [new tag]         v1.6.8.11  -> v1.6.8.11
 * [new tag]         v1.6.8.2   -> v1.6.8.2
 * [new tag]         v1.6.8.3   -> v1.6.8.3
 * [new tag]         v1.6.8.4   -> v1.6.8.4
 * [new tag]         v1.6.8.5   -> v1.6.8.5
 * [new tag]         v1.6.8.6   -> v1.6.8.6
 * [new tag]         v1.6.8.7   -> v1.6.8.7
 * [new tag]         v1.6.8.8   -> v1.6.8.8
 * [new tag]         v1.6.8.9   -> v1.6.8.9
 * [new tag]         v1.6.9     -> v1.6.9
 * [new tag]         v1.6.9.1   -> v1.6.9.1
 * [new tag]         v1.6.9.2   -> v1.6.9.2
 * [new tag]         v1.6.9.3   -> v1.6.9.3
 * [new tag]         v1.6.9.4   -> v1.6.9.4
 * [new tag]         v1.6.9.5   -> v1.6.9.5
 * [new tag]         v1.6.9.6   -> v1.6.9.6
 * [new tag]         v1.6.9.7   -> v1.6.9.7
 * [new tag]         v1.6.9.8   -> v1.6.9.8
Getting manifest ...
   from http://src.chromium.org/git/manifestz
fatal: http://src.chromium.org/git/manifestz/info/refs not found: did you run 
git update-server-info on the server?
fatal: cannot obtain manifest http://src.chromium.org/git/manifestz
kliegs@kliegs-chrome:~/repo_test$ repo init -u 
http://src.chromium.org/git/manifestz -m minilayout.xml
Traceback (most recent call last):
  File "/home/kliegs/repo_test/.repo/repo/main.py", line 235, in <module>
    _Main(sys.argv[1:])
  File "/home/kliegs/repo_test/.repo/repo/main.py", line 217, in _Main
    repo._Run(argv)
  File "/home/kliegs/repo_test/.repo/repo/main.py", line 123, in _Run
    cmd.Execute(copts, cargs)
  File "/home/kliegs/repo_test/.repo/repo/subcmds/init.py", line 219, in Execute
    self._SyncManifest(opt)
  File "/home/kliegs/repo_test/.repo/repo/subcmds/init.py", line 110, in _SyncManifest
    m.PreSync()
  File "/home/kliegs/repo_test/.repo/repo/project.py", line 1505, in PreSync
    cb = self.CurrentBranch
  File "/home/kliegs/repo_test/.repo/repo/project.py", line 276, in CurrentBranch
    b = self.work_git.GetHead()
  File "/home/kliegs/repo_test/.repo/repo/project.py", line 1291, in GetHead
    fd = open(path, 'rb')
IOError: [Errno 2] No such file or directory: 
'/home/kliegs/repo_test/.repo/manifests/.git/HEAD'
kliegs@kliegs-chrome:~/repo_test$ repo init -u 
http://src.chromium.org/git/manifest -m minilayout.xml
Traceback (most recent call last):
  File "/home/kliegs/repo_test/.repo/repo/main.py", line 235, in <module>
    _Main(sys.argv[1:])
  File "/home/kliegs/repo_test/.repo/repo/main.py", line 217, in _Main
    repo._Run(argv)
  File "/home/kliegs/repo_test/.repo/repo/main.py", line 123, in _Run
    cmd.Execute(copts, cargs)
  File "/home/kliegs/repo_test/.repo/repo/subcmds/init.py", line 219, in Execute
    self._SyncManifest(opt)
  File "/home/kliegs/repo_test/.repo/repo/subcmds/init.py", line 110, in _SyncManifest
    m.PreSync()
  File "/home/kliegs/repo_test/.repo/repo/project.py", line 1505, in PreSync
    cb = self.CurrentBranch
  File "/home/kliegs/repo_test/.repo/repo/project.py", line 276, in CurrentBranch
    b = self.work_git.GetHead()
  File "/home/kliegs/repo_test/.repo/repo/project.py", line 1291, in GetHead
    fd = open(path, 'rb')
IOError: [Errno 2] No such file or directory: 
'/home/kliegs/repo_test/.repo/manifests/.git/HEAD'
kliegs@kliegs-chrome:~/repo_test$ repo init -u 
http://src.chromium.org/git/manifestz -m minilayout.xml^C
kliegs@kliegs-chrome:~/repo_test$ ^C
kliegs@kliegs-chrome:~/repo_test$ erpo ^C
kliegs@kliegs-chrome:~/repo_test$ repo --version
repo version v1.6.10.2
       (from http://android.git.kernel.org/tools/repo.git)
git version 1.7.2.1
Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) 
[GCC 4.4.1]
kliegs@kliegs-chrome:~/repo_test$ uname -a
Linux kliegs-chrome 2.6.31-22-generic #61-Ubuntu SMP Wed Jul 28 02:02:56 UTC 
2010 x86_64 GNU/Linux

Original issue reported on code.google.com by kliegs@chromium.org on 27 Aug 2010 at 3:46

GoogleCodeExporter commented 9 years ago
This is also valid if you start repo init and then interrupts with a ctrl-c, no 
matter if the url is correct or not. I agree that repo should preferrably 
handle this case without the rm intervention necessary today.

Original comment by fredrik....@sonyericsson.com on 6 Sep 2010 at 3:16