petemoore / git-repo

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

manifest/project.list shouldn't die if project doesn't exist #50

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I get the following crash if I have already deleted
packages/apps/SOME_PACKAGE locally. I think it should just continue on, as
it's just going to try to delete it anyway.

This is after removing packages/apps/SOME_PACKAGE from manifest.xml and
re-syncing.

Fetching projects: 100% (163/163), done.
Traceback (most recent call last):
  File "/home/USERNAME/projects/PROJECTNAME/.repo/repo/main.py", line 235,
in <module>
    _Main(sys.argv[1:])
  File "/home/USERNAME/projects/PROJECTNAME/.repo/repo/main.py", line 217,
in _Main
    repo._Run(argv)
  File "/home/USERNAME/projects/PROJECTNAME/.repo/repo/main.py", line 123,
in _Run
    cmd.Execute(copts, cargs)
  File "/home/USERNAME/projects/PROJECTNAME/.repo/repo/subcmds/sync.py",
line 229, in Execute
    if self.UpdateProjectList():
  File "/home/USERNAME/projects/PROJECTNAME/.repo/repo/subcmds/sync.py",
line 152, in UpdateProjectList
    if project.IsDirty():
  File "/home/USERNAME/projects/PROJECTNAME/.repo/repo/project.py", line
289, in IsDirty
    '--refresh')
  File "/home/USERNAME/projects/PROJECTNAME/.repo/repo/project.py", line
1303, in runner
    capture_stderr = True)
  File "/home/USERNAME/projects/PROJECTNAME/.repo/repo/git_command.py",
line 189, in __init__
    raise GitError('%s: %s' % (command[1], e))
error.GitError: update-index: [Errno 2] No such file or directory:
'/home/USERNAME/projects/PROJECTNAME/packages/apps/SOME_PACKAGE'

Original issue reported on code.google.com by m.bn...@gmail.com on 25 Sep 2009 at 7:25

GoogleCodeExporter commented 9 years ago
Here is the fix.

Tested by modifying Android's manifest.xml to only contain external/ after a 
fresh
repo init, repo syncing, and seeing no error message.

I can't think of any cases where this would be problematic, as it was about to 
be
deleted anyway.

Original comment by m.bn...@gmail.com on 26 Sep 2009 at 2:29

Attachments:

GoogleCodeExporter commented 9 years ago
Can you follow SUBMITTING_PATCHES and upload your patch for review at 
review.source.android.com?

Original comment by sop+code@google.com on 26 Sep 2009 at 7:14

GoogleCodeExporter commented 9 years ago
https://review.source.android.com/#change,11960

Original comment by m.bn...@gmail.com on 26 Sep 2009 at 9:48

GoogleCodeExporter commented 9 years ago
I encountered the problem when I removed the whole workspace,
rm -rf $WORKSPACE/*
deleting everything except the hidden .repo directory.
This was to get a quick sync but a completely clean build.
If you've done that, you can work around this bug by doing
rm -f .repo/project.list
also before you do repo sync.

Original comment by ern...@gmail.com on 3 Mar 2010 at 3:49

GoogleCodeExporter commented 9 years ago
We are having this issue.

Is there a resolution?

Original comment by bruce.e.james on 8 Oct 2014 at 1:33