本文整理汇总了Python中RepSys.svn.SVN.log方法的典型用法代码示例。如果您正苦于以下问题:Python SVN.log方法的具体用法?Python SVN.log怎么用?Python SVN.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RepSys.svn.SVN
的用法示例。
在下文中一共展示了SVN.log方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rev_touched_url
# 需要导入模块: from RepSys.svn import SVN [as 别名]
# 或者: from RepSys.svn.SVN import log [as 别名]
def rev_touched_url(url, rev):
svn = SVN()
info = svn.info2(url)
if info is None:
raise Error, "can't fetch svn info about the URL: %s" % url
root = info["Repository Root"]
urlpath = url[len(root):]
touched = False
entries = svn.log(root, start=rev, limit=1)
entry = entries[0]
for change in entry.changed:
path = change.get("path")
if path and path.startswith(urlpath):
touched = True
return touched
示例2: svn2rpm
# 需要导入模块: from RepSys.svn import SVN [as 别名]
# 或者: from RepSys.svn.SVN import log [as 别名]
def svn2rpm(pkgdirurl, rev=None, size=None, submit=False,
template=None, macros=[], exported=None):
concat = config.get("log", "concat", "").split()
revoffset = get_revision_offset()
svn = SVN()
pkgreleasesurl = layout.checkout_url(pkgdirurl, releases=True)
pkgcurrenturl = layout.checkout_url(pkgdirurl)
releaseslog = svn.log(pkgreleasesurl, noerror=1)
currentlog = svn.log(pkgcurrenturl, limit=size, start=rev,
end=revoffset)
# sort releases by copyfrom-revision, so that markreleases for same
# revisions won't look empty
releasesdata = []
if releaseslog:
for relentry in releaseslog[::-1]:
try:
(version, release, relrevision) = \
parse_markrelease_log(relentry)
except InvalidEntryError:
continue
releasesdata.append((relrevision, -relentry.revision, relentry,
version, release))
releasesdata.sort()
# collect valid releases using the versions provided by the changes and
# the packages
prevrevision = 0
releases = []
for (relrevision, dummy, relentry, version, release) in releasesdata:
if prevrevision == relrevision:
# ignore older markrelease of the same revision, since they
# will have no history
continue
entries = [entry for entry in currentlog
if relrevision >= entry.revision and
(prevrevision < entry.revision)]
if not entries:
#XXX probably a forced release, without commits in current/,
# check if this is the right behavior
sys.stderr.write("warning: skipping (possible) release "
"%s-%[email protected]%s, no commits since previous markrelease (r%r)\n" %
(version, release, relrevision, prevrevision))
continue
release = make_release(author=relentry.author,
revision=relentry.revision, date=relentry.date,
lines=relentry.lines, entries=entries,
version=version, release=release)
releases.append(release)
prevrevision = relrevision
# look for commits that have been not submitted (released) yet
# this is done by getting all log entries newer (greater revision no.)
# than releasesdata[-1] (in the case it exists)
if releasesdata:
latest_revision = releasesdata[-1][0] # the latest copied rev
else:
latest_revision = 0
notsubmitted = [entry for entry in currentlog
if entry.revision > latest_revision]
if notsubmitted:
# if they are not submitted yet, what we have to do is to add
# a release/version number from getrelease()
version, release = getrelease(pkgdirurl, macros=macros,
exported=exported)
toprelease = make_release(entries=notsubmitted, released=False,
version=version, release=release)
releases.append(toprelease)
data = dump_file(releases[::-1], currentlog=currentlog, template=template)
return data