repo re-init in existing client finally supported?

2,138 views
Skip to first unread message

Shawn Pearce

unread,
Mar 9, 2009, 9:59:40 PM3/9/09
to repo-discuss
I think I finally have "repo init -b foo" working in an existing client.

E.g., I can switch between cupcake and master now:

  mkdir mydroid
  cd mydroid

  repo init -u git://android.git.kernel.org/platform/manifest.git
  repo sync
  ...

  repo init -b cupcake
  repo sync
  ...

  repo init -b master
  repo sync

This needs https://review.source.android.com/9112, which is not-yet-tagged, so you need to actually do:

    repo init -u git://android.git.kernel.org/platform/manifest.git --repo-branch=master --repo-no-verify

to permit repo to execute the unsigned revision.

Or, do a normal repo init, and pull the change manually into the client:

  (cd .repo/repo && git pull git://android.git.kernel.org/tools/repo refs/changes/12/9112/1)

johnny

unread,
Mar 18, 2009, 11:13:10 PM3/18/09
to Repo and Gerrit Discussion
Hi Shawn,

What happens if I initially with --mirror option? For example,
initially I mirrored the master branch, and now I want to switch to
the cupcake branch. What will repo do? Will it prune the projects that
not in the manifest file of master branch?

Thanks,
Johnny Xia.

On Mar 10, 9:59 am, Shawn Pearce <s...@google.com> wrote:
> I think I finally have "repo init -b foo" working in an existing client.
>
> E.g., I can switch between cupcake and master now:
>
>   mkdir mydroid
>   cd mydroid
>
>   repo init -u git://android.git.kernel.org/platform/manifest.git
>   repo sync
>   ...
>
>   repo init -b cupcake
>   repo sync
>   ...
>
>   repo init -b master
>   repo sync
>
> This needshttps://review.source.android.com/9112, which is not-yet-tagged,

Shawn Pearce

unread,
Mar 18, 2009, 11:27:38 PM3/18/09
to repo-d...@googlegroups.com

Nope, it doesn't know how to prune.  But it will stop updating them, as it doesn't know about them in the manifest.

On Mar 18, 2009 8:13 PM, "johnny" <john...@gmail.com> wrote:


Hi Shawn,

What happens if I initially with --mirror option? For example,
initially I mirrored the master branch, and now I want to switch to
the cupcake branch. What will repo do? Will it prune the projects that
not in the manifest file of master branch?

Thanks,
Johnny Xia.

On Mar 10, 9:59 am, Shawn Pearce <s...@google.com> wrote: > I think I finally have "repo init -b fo...

> This needshttps://review.source.android.com/9112, which is not-yet-tagged,

> so you need to actually do: > >     repo init -u > git://android.git.kernel.org/platform/manifest....


johnny

unread,
Mar 19, 2009, 1:10:37 AM3/19/09
to Repo and Gerrit Discussion
Is it merged into the latest repo? I just tried the command right now.
It complains that "default" branch already exists while syncing the
manifest project.

On Mar 19, 11:27 am, Shawn Pearce <s...@google.com> wrote:
> Nope, it doesn't know how to prune.  But it will stop updating them, as it
> doesn't know about them in the manifest.
>

Naseer

unread,
Mar 19, 2009, 9:34:01 AM3/19/09
to Repo and Gerrit Discussion
Hi Shawn,
Does this work with tags as well ?

Thanks,
-Naseer

Shawn Pearce

unread,
Mar 19, 2009, 10:50:20 AM3/19/09
to repo-d...@googlegroups.com
On Wed, Mar 18, 2009 at 22:10, johnny <john...@gmail.com> wrote:
>
> Is it merged into the latest repo? I just tried the command right now.
> It complains that "default" branch already exists while syncing the
> manifest project.

Yes. What version of repo do you have? It was added in 1.6.3:

$ repo version
repo version v1.6.3
(from git://android.git.kernel.org/tools/repo.git)
git version 1.6.2.1.337.g6270ba
Python 2.4.3 (#2, Jul 31 2008, 21:56:52)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)]

Shawn Pearce

unread,
Mar 19, 2009, 10:50:40 AM3/19/09
to repo-d...@googlegroups.com
On Thu, Mar 19, 2009 at 06:34, Naseer <naseer...@gmail.com> wrote:
>
> Does this work with tags as well ?

No. repo init -b still requires a branch head.

Naseer

unread,
Mar 19, 2009, 12:39:18 PM3/19/09
to Repo and Gerrit Discussion
Will it work with tags someday ?

Thanks,
-Naseer

On Mar 19, 7:50 pm, Shawn Pearce <s...@google.com> wrote:

Shawn Pearce

unread,
Mar 19, 2009, 12:46:46 PM3/19/09
to repo-d...@googlegroups.com
On Thu, Mar 19, 2009 at 09:39, Naseer <naseer...@gmail.com> wrote:
>
> Will it work with tags someday ?

I'd like it to.

The issue is actually spending the time making it do so. :-)

johnny

unread,
Mar 20, 2009, 1:51:47 AM3/20/09
to Repo and Gerrit Discussion
Yes, it's v1.6.3
Here is we I do:
$ repo init -u git://android.git.kernel.org/platform/manifest.git --
mirror
$ repo sync
$ repo init -b cupcake
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://android.git.kernel.org/platform/manifest
334653a..f6b276c master -> origin/master
info: [manifests] Manifest switched from refs/remotes/origin/master to
refs/remotes/origin/cupcake
info: [manifests] Discarding 1 commits removed from upstream
fatal: A branch named 'default' already exists.
Traceback (most recent call last):
File "/lnxprj/mydroid/.repo/repo/main.py", line 224, in <module>
_Main(sys.argv[1:])
File "/lnxprj/mydroid/.repo/repo/main.py", line 208, in _Main
repo._Run(argv)
File "/lnxprj/mydroid/.repo/repo/main.py", line 115, in _Run
cmd.Execute(copts, cargs)
File "/disk3/mydroid/.repo/repo/subcmds/init.py", line 192, in
Execute
File "/disk3/mydroid/.repo/repo/subcmds/init.py", line 124, in
_SyncManifest
File "/lnxprj/mydroid/.repo/repo/project.py", line 734, in
StartBranch
raise GitError('%s checkout %s ' % (self.name, rev))
error.GitError: manifests checkout refs/remotes/origin/cupcake


On Mar 19, 10:50 pm, Shawn Pearce <s...@google.com> wrote:

johnny

unread,
Mar 20, 2009, 1:54:33 AM3/20/09
to Repo and Gerrit Discussion
Right now my workaround is: go to .repo folder and delete the folder
manifests and manifest.git; second, type
$ repo init -b
$ repo sync

This seems to work well.

Thanks,
Johnny Xia.

Shawn Pearce

unread,
Mar 20, 2009, 10:57:45 AM3/20/09
to repo-d...@googlegroups.com
On Thu, Mar 19, 2009 at 22:51, johnny <john...@gmail.com> wrote:
>
> Yes, it's v1.6.3
...

> File "/disk3/mydroid/.repo/repo/subcmds/init.py", line 124, in
> _SyncManifest

No, it must be 1.6.2. The _SyncManifest call was on line 124 in
1.6.2, and this bug existed in 1.6.2. In 1.6.3 I fixed the bug, and
this line moved to be on 202.

Is your repo wrapper script pulling from a stale client repository?

I just initialized a brand new mirror, got repo 1.6.3, and the second
"repo init -b cupcake" works fine under it.

johnny

unread,
Mar 22, 2009, 9:56:33 PM3/22/09
to Repo and Gerrit Discussion
Yes, it is 1.6.2. Sorry I mixed reading the version of repo with GIT's
version which is 1.5.6.3.

Regards,
Johnny Xia.

On Mar 20, 10:57 pm, Shawn Pearce <s...@google.com> wrote:
Reply all
Reply to author
Forward
0 new messages