itsmiru / git-repo

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

repo sync seems to skip copyfile actions? #171

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Affected Version:
Environment:

trond@ok:1077> repo version 
repo version v1.12.16
       (from https://gerrit.googlesource.com/git-repo)
repo launcher version 1.21
       (from /Users/trond/bin/repo)
git version 2.0.0
Python 2.7.7 (default, Jun 14 2014, 23:12:13)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]

What steps will reproduce the problem?
1. Create a manifest file with a project that have a copyfile like:

  <project name="tlm">
    <copyfile src="Makefile" dest="Makefile"/>
  </project>

2. do an initial sync

3. change the Makefile in the upstream repo

4. run "repo sync"

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

The expected outcome of this is that the file I requested a copy of is updated, 
but it instead it contains the previous version of the file.

Original issue reported on code.google.com by trond.no...@gmail.com on 27 Jun 2014 at 8:05

GoogleCodeExporter commented 8 years ago
Here is another way to reproduce this issue.

  # go to the root of your aosp tree
  $ rm Makefile
  $ repo sync build

Observe that "Makefile" is not recreated, despite the following entry in the 
manifest (android-4.4.2_r1):

  <project path="build" name="platform/build" groups="pdk" >
    <copyfile src="core/root.mk" dest="Makefile" />
  </project>

Original comment by james.m...@graphitesoftware.com on 8 Oct 2014 at 8:02

GoogleCodeExporter commented 8 years ago
I just discovered a work-around.  Use the "--detach" option ("-d" for short):

  # go to the root of your aosp tree
  $ rm Makefile
  $ repo sync --detach build

Observe that "Makefile" is recreated. Yay! :-)

When you don't use "--detach", I think repo tries to respect your local 
changes, so perhaps it is functioning as designed when it does not recreate 
"Makefile" (i.e. perhaps this is not a bug).

When I repo sync in my own tree, I tend to use "--detach" most of the time 
since I am a little wary about the auto-rebase repo does otherwise.

Original comment by james.m...@graphitesoftware.com on 8 Oct 2014 at 8:24

GoogleCodeExporter commented 8 years ago
I created a small patch for fixing this "bug". I'm not quite sure whether it's 
a bug or a feature, but I definitely prefer the behaviour to re-create the 
link/copy file by default, without the -d

Original comment by fabien.c...@gmail.com on 13 Nov 2014 at 8:58

Attachments: