10

I'm using repo, which is used by Android project, to manage my project.

Is there a tool to create repo manifest file with SHA based on current work directory as the following?

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="git://address.com/" name="origin" review="review.address.com"/>
<default remote="origin" revision="ics-something" sync-j="4"/>
<manifest-server url="http://manifests.address.com:8000"/>
<!-- sniff -->
<project name="platform/frameworks/base" path="frameworks/base"
       revision="ecb41a77411358d385e3fde5b4e98a5f3d9cfdd5"/>
<project name="platform/packages/apps/Bluetooth" path="packages/apps/Bluetooth"
       revision="621bae79f1a250e443eb83d1f473c533bea493dc"/>
<!-- sniff -->
</manifest>

I mean to create a new manifest file base the current manifest, and the project revision value is the HEAD SHA of projects in current work directory.

Thank you in advance.

gzh
  • 3,507
  • 2
  • 19
  • 23

1 Answers1

24

The repo manifest command creates manifest files with fixed SHA-1s based on the current workspace.

repo manifest -r -o my-manifest.xml
Magnus Bäck
  • 11,381
  • 3
  • 47
  • 59
  • 2
    thanks. I tried the command, by it do not output SHA. After reference to the help message, I can use ` repo manifest -r --suppress-upstream-revision -o my-manifest.xml ` to output SHA, but the path field in manifest was lost. – gzh Oct 09 '15 at 05:51
  • That's probably because of `--suppress-upstream-revision`. I'd forgotten about `-r` and I've updated the answer to include it. – Magnus Bäck Oct 09 '15 at 11:15
  • `--suppress-upstream-revision` only suppress the upstream attribute of project in manifest file, Besides the SHA-1s, I also want the path attribute to be output as the original one. – gzh Oct 13 '15 at 06:17