summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/svn.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/svn.py')
-rw-r--r--bitbake/lib/bb/fetch2/svn.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py
index ea5902e05b..30c4b91b88 100644
--- a/bitbake/lib/bb/fetch2/svn.py
+++ b/bitbake/lib/bb/fetch2/svn.py
@@ -27,6 +27,7 @@ import os
27import sys 27import sys
28import logging 28import logging
29import bb 29import bb
30import re
30from bb import data 31from bb import data
31from bb.fetch2 import FetchMethod 32from bb.fetch2 import FetchMethod
32from bb.fetch2 import FetchError 33from bb.fetch2 import FetchError
@@ -89,6 +90,8 @@ class Svn(FetchMethod):
89 90
90 if command == "info": 91 if command == "info":
91 svncmd = "%s info %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module) 92 svncmd = "%s info %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
93 elif command == "log1":
94 svncmd = "%s log --limit 1 %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
92 else: 95 else:
93 suffix = "" 96 suffix = ""
94 if ud.revision: 97 if ud.revision:
@@ -165,14 +168,13 @@ class Svn(FetchMethod):
165 """ 168 """
166 Return the latest upstream revision number 169 Return the latest upstream revision number
167 """ 170 """
168 bb.fetch2.check_network_access(d, self._buildsvncommand(ud, d, "info")) 171 bb.fetch2.check_network_access(d, self._buildsvncommand(ud, d, "log1"))
169 172
170 output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "info"), d, True) 173 output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "log1"), d, True)
171 174
172 revision = None 175 # skip the first line, as per output of svn log
173 for line in output.splitlines(): 176 # then we expect the revision on the 2nd line
174 if "Last Changed Rev" in line: 177 revision = re.search('^r([0-9]*)', output.splitlines()[1]).group(1)
175 revision = line.split(":")[1].strip()
176 178
177 return revision 179 return revision
178 180