Ticket #230 (new defect)

Opened 2 years ago

Last modified 13 months ago

Can't get the right "got_revision" property from a previous source.SVN(mode=export) step

Reported by: fontanon Owned by:
Priority: major Milestone: 0.8.+
Version: 0.7.6 Keywords:
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

Changed 2 years ago by fontanon

As Dustin says in mailing list:

This looks like a bug, actually -- the slave runs 'svnversion' in the new build directory, but since there are no .svn directories, it doesn't get a revision.

Changed 2 years ago by dustin

  • cc dustin added

Changed 23 months 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.

Changed 23 months 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.

Changed 18 months 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.

Changed 13 months 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.

Note: See TracTickets for help on using tickets.