Can I reuse old repo to get new code with new tag ?

79 views
Skip to first unread message

lingy...@gmail.com

unread,
Feb 9, 2009, 9:21:33 PM2/9/09
to Repo and Gerrit Discussion
Hi,
I have one repo which is repo init/synced from one local repo mirror
with tag v1.0.
Now I want to get code with tag v2.0 in this repo. I use follow steps,
seems that it doesn't work. Could you please guide me the right way?

Steps
1. Update manifest.xml under .repo, replace v1.0 to v2.0 as below,
<default revision="refs/tags/v2.0" remote="android" />.

2. Run repo sync. It failed as below:
$ repo sync
Traceback (most recent call last):
File "/path/to/test_manifest/.repo/repo/main.py", line 202, in ?
_Main(sys.argv[1:])
File "/path/to/test_manifest/.repo/repo/main.py", line 186, in _Main
repo._Run(argv)
File "/path/to/test_manifest/.repo/repo/main.py", line 96, in _Run
cmd.Execute(copts, cargs)
File "/path/to/test_manifest/.repo/repo/subcmds/sync.py", line 106,
in Execute
if not project.Sync_LocalHalf():
File "/path/to/test_manifest/.repo/repo/project.py", line 618, in
Sync_LocalHalf
lost = self._revlist(not_rev(rev), HEAD)
File "/path/to/test_manifest/.repo/repo/project.py", line 1027, in
_revlist
return self.work_git.rev_list(*args)
File "/path/to/test_manifest/.repo/repo/project.py", line 1171, in
rev_list
raise GitError('%s rev-list %s: %s' % (
error.GitError: platform/bionic rev-list (u'^refs/tags/v2.0', 'HEAD'):
fatal: bad revision '^refs/tags/v2.0'

Thanks,
Emily

Shawn Pearce

unread,
Feb 10, 2009, 10:18:42 AM2/10/09
to repo-d...@googlegroups.com
It tried to switch to v2.0.  Are you sure all projects have a v2.0 tag?

... platform/bionic rev-list (u'^refs/tags/v2.0' ...

seems to suggest your platform/bionic doesn't have a v2.0 tag yet.

lingy...@gmail.com

unread,
Feb 10, 2009, 10:12:17 PM2/10/09
to Repo and Gerrit Discussion
Shawn,

I checked server's repo, tag v2.0 exists.

I created a new manifest.git, added <default revision="refs/tags/v2.0"
remote="myandroid" /> in default.xml.
Then I created a new folder, and tried to repo init/sync from this
manifest.git, it succeeded.

Do you have any clue?

Thanks,
Emily


On Feb 10, 11:18 pm, Shawn Pearce <s...@google.com> wrote:
> It tried to switch to v2.0.  Are you sure all projects have a v2.0 tag?
>
> ... platform/bionic rev-list (u'^refs/tags/v2.0' ...
>
> seems to suggest your platform/bionic doesn't have a v2.0 tag yet.
>
> On Mon, Feb 9, 2009 at 18:21, lingyan....@gmail.com
> <lingyan....@gmail.com>wrote:
> > Emily- Hide quoted text -
>
> - Show quoted text -

Shawn Pearce

unread,
Feb 10, 2009, 10:16:50 PM2/10/09
to repo-d...@googlegroups.com
Oh.  Wait.  My guess is, its not ensuring the tags are fetched.  There were no new commits in that project, so git fetch didn't consider tags.

You can manually do:

  repo forall -c git fetch --tags
  repo sync

That will "fix" the first client.

lingy...@gmail.com

unread,
Feb 11, 2009, 1:59:28 AM2/11/09
to Repo and Gerrit Discussion
Shawn,

Thank you very much for your guide !

Since some new projects are added in v2.0, only updating revision to
v2.0 doesn't work. I tried to replace manifest.xml in .repo with the
manifest.xml which was used to apply tag v2.0. Repo sync works now.

But it has some error "error: refs/remotes/m/master points nowhere!",
while repo sync still goes on. Do you know what's the problem ? When
I tried "repo sync " again, the error was gone. Do you know what's the
problem ? Does this mean "repo sync" is successful ?

test_manifest $ repo sync
error: refs/remotes/m/master points nowhere!
warning: no common commits
remote: Counting objects: 27224, done.
remote: Compressing objects: 100% (24203/24203), done.
remote: Total 27224 (delta 2748), reused 27191 (delta 2730)
Receiving objects: 100% (27224/27224), 74.03 MiB | 11147 KiB/s, done.
Resolving deltas: 100% (2748/2748), done.
From git://host/path/to/kernel
* [new branch] mydroid-> mydroid-2.6.27
* [new tag] v2.0-> v2.0
...
info: [platform/hardware/ril] Discarding 1 commits
info: [kernel] Discarding 1 commits
Checking out files: 100% (696/696), done.
info: [motorola/sbf] Discarding 2 commits
Checking out files: 100% (810/810), done.
info: [platform/packages/apps/AlarmClock] Discarding 7 commits
info: [platform/packages/apps/Browser] Discarding 8 commits
info: [platform/packages/apps/Calculator] Discarding 7 commits
info: [platform/packages/apps/Calendar] Discarding 7 commits
info: [platform/packages/apps/Camera] Discarding 9 commits
info: [platform/packages/apps/Contacts] Discarding 9 commits
info: [platform/packages/apps/Email] Discarding 9 commits

Thanks,
Emily

On Feb 11, 11:16 am, Shawn Pearce <s...@google.com> wrote:
> Oh.  Wait.  My guess is, its not ensuring the tags are fetched.  There were
> no new commits in that project, so git fetch didn't consider tags.
>
> You can manually do:
>
>   repo forall -c git fetch --tags
>   repo sync
>
> That will "fix" the first client.
>
> On Tue, Feb 10, 2009 at 19:12, lingyan....@gmail.com
> <lingyan....@gmail.com>wrote:
> > > - Show quoted text -- Hide quoted text -

Shawn Pearce

unread,
Feb 11, 2009, 10:37:17 AM2/11/09
to repo-d...@googlegroups.com
That m/master error is about a remote branch disappearing, though I'm not sure why it did.  If its actually stopped outputting it, it means repo was able to fix the issue on its own.  If not, you may want to go into that project and rm .git/refs/remotes/m/master manually to remove the stale m/master pointer.
Reply all
Reply to author
Forward
0 new messages