esrlabs / git-repo

repo - The multiple repository tool (also works on MS Windows!)
https://code.google.com/p/git-repo/
Apache License 2.0
438 stars 145 forks source link

repo don't support refs/changes/... in XML #23

Closed Fassino closed 9 years ago

Fassino commented 9 years ago

Hi,

It seem that this repo not support refs/changes/... in XML, while it's supported by Android. Such construction is required when doing Jenkins continuous integration on patch submitted to gerrit.

Applying such patch fix (inspired from Android):

$ git diff
diff --git a/git_config.py b/git_config.py
index 8a9b46c..e45a265 100644
--- a/git_config.py
+++ b/git_config.py
@@ -652,6 +652,10 @@ class Remote(object):
         for spec in self.fetch:
             if spec.SourceMatches(rev):
                 return spec.MapSource(rev)
+
+        if not rev.startswith(R_HEADS):
+              return rev
+
         raise GitError('remote %s does not have %s' % (self.name, rev))

     def WritesTo(self, ref):
diff --git a/project.py b/project.py
index 5d9a4a6..a4b8cec 100644
--- a/project.py
+++ b/project.py
@@ -1675,9 +1675,9 @@ class Project(object):
             branch = self.revisionExpr
             if is_sha1:
                 branch = self.upstream
-            if branch.startswith(R_HEADS):
-                branch = branch[len(R_HEADS):]
-            cmd.append(('+refs/heads/%s:' % branch) + remote.ToLocal('refs/head
+            if not branch.startswith('refs/'):
+                branch = R_HEADS + branch
+            cmd.append(('+%s:' % branch) + remote.ToLocal(branch))

         ok = False
         for _i in range(2):

Is it possible to integrate it in master branch ?

Thanks & Best regards, JP

zhanghaowx commented 9 years ago

Agree that is a missing feature. Will need it on Jenkins...

mputz86 commented 9 years ago

hey there, thanks for the issue (and push-comment ;)), we are currently rebuilding the whole project with the stuff we learned in this version and put it on the base of the current android git-repo. We will push it for testing in a few days, so then the proposed feature will be available. I will add a comment here, when it is finally pushed. Best Regards

mputz86 commented 9 years ago

pushed on branch stable, could you verify that the feature is now available elsewise reopen the issue? Thank you