Ticket #230 (closed defect: fixed)
svn mode=export does not get a got_revision
| Reported by: | fontanon | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 0.8.2 |
| Version: | 0.7.6 | Keywords: | svn |
| Cc: | dustin |
Description
Working with subversion, you always take got_revision property with None value on slave-side if you previously get the source with a source.SVN(mode=export) step.
With any other modes (clobber, update, copy) it works.
Change History
comment:3 Changed 5 years ago by warner
to make 'got_revision' work for export, we need to do something very differently on the slave side. 'export', by definition, creates a snapshot/copy of the source tree without any VC metadata, so there's nothing to ask about what revision was obtained.
For SVN, we used to parse the output of the 'svn update' / checkout / export command, since it usually announces the revision number it used (in the last line of stdout). We stopped doing that, I think because it didn't seem reliable enough, but I'm not really sure at this point. One option is to start doing that again, at least for export.
Another option is more complicated, by breaking export up into two separate steps:
- 'svn info' to find out what the current version is
- 'svn export -r NNN' to export exactly that version
- report NNN as the got_revision
Of course, this is only appropriate when 'revision' is None: i.e. we're supposed to fetch HEAD.
Not sure what the best approach is.. I think I prefer the parse-stdout one, but maybe we should just declare that you don't get a got_revision for mode=export.
comment:4 Changed 5 years ago by dustin
I prefer the solution you specify as "more complicated" -- it doesn't seem terribly complicated, and has the advantage of reliably acting just like the other svn modes.
comment:5 Changed 5 years ago by fontanon
It's seems to be a good solution. Meanwhile i'm using a horrible solution based on source.SVN(mode=update), then get the revision on slave then do a ShellCommand? that does the .svn deletion.
class RemoveSVN(ShellCommand):
""" Removes the .svn directories recursively"""
name = "RemoveSVN"
command = ["rm", "-rf", "$(find -name .svn)"]
description = [name]
def __init__(self, **kwargs):
ShellCommand.__init__(self, **kwargs)
It maybe can be useful for someone with same problem that will read this ticket.
comment:6 Changed 4 years ago by dustin
- Milestone changed from undecided to 0.7.+
I'd like to get this in 0.7.10, but unless someone hacks it up in time, it's slipping.
comment:7 Changed 3 years ago by dustin
- Keywords svn added
- Summary changed from Can't get the right "got_revision" property from a previous source.SVN(mode=export) step to svn mode=export does not get a got_revision
- Milestone changed from 0.8.+ to 0.8.1
comment:9 Changed 3 years ago by Dustin J. Mitchell
- Status changed from new to closed
- Resolution set to fixed
Merge branch 'ticket_230' of git://github.com/gvalkov/buildbot
- 'ticket_230' of git://github.com/gvalkov/buildbot: Set the 'got_revision' property when mode is 'export' (Ticket #230)
Fixes #230
Changeset: 8f3da32263312a77bf202b9f59d9d8bd0105cffc
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
As Dustin says in mailing list: