[svn] Add @rev to svn checkout command
authorHolger Hans Peter Freyther <zecke@selfish.org>
Mon, 3 Nov 2008 12:55:17 +0000 (12:55 +0000)
committerHolger Hans Peter Freyther <zecke@selfish.org>
Mon, 3 Nov 2008 12:55:17 +0000 (12:55 +0000)
Patch by borgcube@gmx.li

Svn tries to be smart about revisions. So, when you check out an older revision of a file it goes to the latest revision (HEAD) and tries to go back to the old file. In this case it was impossible, since the whole thing was moved outside of svn's scope, so svn can't find the file in the HEAD revision.

Svn treats this situation as an exception and provides the "peg-revision"-syntax for that. So where you would normally do
svn co -r1337 http://url/to/somewhere/module module

you would now have to do
svn co -r1337 http://url/to/somewhere/module@1337 module,
the @1337 telling svn to go start looking at revision 1337 instead of HEAD.

ChangeLog
lib/bb/fetch/svn.py

index 5b46ec2..37926c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -60,6 +60,7 @@ Changes in BitBake 1.8.x:
          used instead of the internal bitbake one. Alternatively, BB_ENV_EXTRAWHITE can be used
          to extend the internal whitelist.
        - Perforce fetcher fix to use commandline options instead of being overriden by the environment
+       - use @rev when doing a svn checkout
 
 Changes in BitBake 1.8.10:
        - Psyco is available only for x86 - do not use it on other architectures.
index 5e5b31b..aead162 100644 (file)
@@ -114,13 +114,15 @@ class Svn(Fetch):
         if command is "info":
             svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module)
         else:
+            suffix = ""
             if ud.revision:
                 options.append("-r %s" % ud.revision)
+                suffix = "@%s" % (ud.revision)
             elif ud.date:
                 options.append("-r {%s}" % ud.date)
 
             if command is "fetch":
-                svncmd = "%s co %s %s://%s/%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, ud.module)
+                svncmd = "%s co %s %s://%s/%s%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module)
             elif command is "update":
                 svncmd = "%s update %s" % (basecmd, " ".join(options))
             else: