Sfoglia il codice sorgente

SVN revision, update to rev

master
Ben Kurtovic 8 anni fa
parent
commit
da5e849b5b
2 ha cambiato i file con 8 aggiunte e 5 eliminazioni
  1. +1
    -1
      README.md
  2. +7
    -4
      lib/kgrader/backend/svn.rb

+ 1
- 1
README.md Vedi File

@@ -15,7 +15,7 @@ version of Ruby.

Install dependencies with gem:

gem install ruby-progressbar
gem install nokogiri ruby-progressbar

Download kgrader over git:



+ 7
- 4
lib/kgrader/backend/svn.rb Vedi File

@@ -1,3 +1,4 @@
require 'nokogiri'
require 'open3'

module KGrader::Backend
@@ -10,8 +11,8 @@ module KGrader::Backend
end

def revision(repo)
# TODO
-1
xml = Nokogiri::XML run('log', '--xml', '-l', '1', repo).first
xml.css('logentry').attr('revision').value.to_i
end

def clone(repo, semester, assignment, student)
@@ -19,8 +20,10 @@ module KGrader::Backend
run 'checkout', '--ignore-externals', url, repo
end

def update(repo)
run 'update', '--ignore-externals', '--accept', 'tf', repo
def update(repo, revision = nil)
args = 'update', '--ignore-externals', '--accept', 'tf'
args.push "-r#{revision}" unless revision.nil?
run *args, repo
end

private


Caricamento…
Annulla
Salva