hadi-guang / git-repo

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

repo manifest subcommand broken for AOSP manifest files that use notdefault groups #120

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Affected Version: 1.17
Environment: AOSP master branch as of 2012-10-24, Ubuntu 12.10 x86

What steps will reproduce the problem?
1. clone AOSP with the master branch manifest: repo init -u <path to mirror or 
server>
2. repo sync 
3. run repo manifest -o - -r in the clone

What is the expected output? What do you see instead?

A manifest file containing the actual git references for each project.

Instead I get a  python stack trace caused by a git rev-parse command:

Traceback (most recent call last):
  File "/srv/data/android-lab/aosp-test/.repo/repo/main.py", line 384, in <module>
    _Main(sys.argv[1:])
  File "/srv/data/android-lab/aosp-test/.repo/repo/main.py", line 364, in _Main
    result = repo._Run(argv) or 0
  File "/srv/data/android-lab/aosp-test/.repo/repo/main.py", line 136, in _Run
    result = cmd.Execute(copts, cargs)
  File "/srv/data/android-lab/aosp-test/.repo/repo/subcmds/manifest.py", line 73, in Execute
    self._Output(opt)
  File "/srv/data/android-lab/aosp-test/.repo/repo/subcmds/manifest.py", line 63, in _Output
    peg_rev = opt.peg_rev)
  File "/srv/data/android-lab/aosp-test/.repo/repo/manifest_xml.py", line 204, in Save
    p.work_git.rev_parse(HEAD + '^0'))
  File "/srv/data/android-lab/aosp-test/.repo/repo/project.py", line 1958, in runner
    capture_stderr = True)
  File "/srv/data/android-lab/aosp-test/.repo/repo/git_command.py", line 221, in __init__
    raise GitError('%s: %s' % (command[1], e))
error.GitError: rev-parse: [Errno 2] No such file or directory: 
'/srv/data/android-lab/aosp-test/prebuilts/eclipse-build-deps'

This is caused by the manifest lines:

<project path="prebuilts/eclipse-build-deps" 
name="platform/prebuilts/eclipse-build-deps" groups="notdefault,eclipse" />
<project path="prebuilts/eclipse-build-deps-sources" 
name="platform/prebuilts/eclipse-build-deps-sources" 
groups="notdefault,eclipse" />

As those don't get checked out by repo sync, but are used for the loop
in the manifest subcommand git rev-parse gets handed the
'prebuilts/eclipse-build-deps' path and fails to find it. The error is
caused by commit bb1b5f5f863fca0e85764f5b35c117f5724d15c0 which
changes the default group in the Save method to 'all'. I think it
should be empty instead as MatchesGroups will do The Right Thing later
on and appends '-all', '-notdefault' if given an empty group setting.

This behavious breaks all tools relying on this command. Jenkins for
example uses it to detect changes in the repositories.

Attached is a patch that fixes this problem.

Original issue reported on code.google.com by ck...@pestilenz.org on 24 Oct 2012 at 11:47

Attachments:

GoogleCodeExporter commented 8 years ago
Please upload your change for review at https://gerrit.googlesource.com/git-repo

Original comment by david.pu...@sonymobile.com on 22 Nov 2012 at 10:38

GoogleCodeExporter commented 8 years ago
Fixed with:

https://gerrit-review.googlesource.com/#/c/40520/

Original comment by david.pu...@sonymobile.com on 1 Feb 2013 at 2:09