Bugs: Browse | Submit New | Admin

[#26209] Vlad::Subversion#export command doesn't export from scm_path anymore by default

Date:
2009-06-12 00:21
Priority:
3
Submitted By:
Adam G (harmon)
Assigned To:
John Barnette (jbarnette)
Category:
vlad
State:
Open
Summary:
Vlad::Subversion#export command doesn't export from scm_path anymore by default

Detailed description
Hi,

As far as I can tell, since I upgraded from 1.2 to 1.3.2, the 
Vlad::Subversion#export method doesn't work like it used to (and should, IMHO).

Basically, since I upgraded, whenever I do a deploy, it updates the scm_path, but ALSO exports from the MASTER svn repo
(not the scm_path folder)! It totally bypasses the point of a local scm folder, which is why I love Vlad.

Here's the big change from History.txt:
1.3.0 / 2009-03-04
* Parameterized ‘head’ into ‘revision’ variable (with head as default). 

Before, `remote_task :update` used to do this:

	run "#{source.export ".", release_path}"
	
Now, it does this:

	run "#{source.export revision, release_path}"
	
This poses a big problem, because the export function inside subversion.rb looks like:	
	
  def export(revision_or_source, destination)
    "#{svn_cmd} #{deploy_via} " +
      if revision_or_source =~ /^(\d+|head)$/i then
        "-r #{revision_or_source} #{repository} #{destination}"
      else
        "#{revision_or_source} #{destination}"
      end
  end
  
  
When `revision_or_source` used to be ".", it exported from the local directory.
Now, it ALWAYS exports from the repo, since `svn export -r...` hits the repo, not the local scm_path. And since `revision`
by default == 'head', it will always take the first if branch.

I have attached my patch from `git format-patch`, along with the patch for the test.

My reasoning is thus: if you provide a revision (be it the default 'head' or something else), it should update the scm_path
with that revision. All export should ever do is export from the scm_path, and NEVER touch the MASTER svn repository.

Let me know what you think, and keep up the good work!

Add A Comment: Notepad

Please login


Followup

Message
Date: 2010-03-30 01:09
Sender: Adam Grant

Bump?

I would think it should just do an rsync command to copy the
/scm contents to /releases/ once `svn checkout` is done. Seems
like `svn export` from the remote repo prevents /scm from being
of any use.
Date: 2009-08-15 16:49
Sender: Arnaud MEURET

Please note that subversion will export from the repository whenever
there is a specific revision stated on the command line; even
from a working copy with the requested revision.
Date: 2009-08-15 13:17
Sender: Arnaud MEURET

Being new to vlad, I was quite appaled by its double transfer
of the code on update. Now I understand the rationale. It is
supposed to export from the remote WC. It makes sense. Now my
interrogation has slipped to "how could such a regression
not have been spotted earlier? ".

Anyway guys, thanks for bringing vlad to the world !
Date: 2009-06-12 00:25
Sender: Adam G

Seems I can't attach a file for some reason, so my diff is
here:
http://github.com/harmon/vlad/commit/845094ac59094bf387a12bf83209
b56216c1cbd4

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tozenspider2009-07-30 00:35zenspider