Class: Svn

Inherits:
Object show all
Defined in:
lib/xiki/svn.rb

Overview

Note:

This file (svn.rb) currently doesn't work.  This is because
repository.rb used to be behave as a common interface to git.rb
and svn.rb, but was recently merged into git.rb, and made svn.rb
no longer used.

To get svn.rb to work again, merge the original
version of repository.rb (pasted and commented at the end of
this file) into this file.  Then map the keys to use Svn
instead of Git

Class Method Summary collapse

Class Method Details

.commit(comment = "") ⇒ Object



31
32
33
# File 'lib/xiki/svn.rb', line 31

def self.commit comment=""
  Tree.siblings
end

.diff(*args) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/xiki/svn.rb', line 45

def self.diff *args
  if args.empty?
    Ol << "empty"
    res = Console.run("svn diff -x -w", :dir=>"$tr", :sync=>true)
    res.gsub!(/\r/, '')
    res.gsub!(/^/, '  ||')
    res.gsub!(/^  \|\|-/, '  -|')
    res.gsub!(/^  \|\|\+/, '  +|')
    res.gsub!(/^  \|\|Index: /, '- ')
    puts res
    return
  end
  Ol << "args: #{args}"
end

.jump_to_diffObject



35
36
37
38
39
40
41
42
43
# File 'lib/xiki/svn.rb', line 35

def self.jump_to_diff
  find = Line.without_indent
  View.handle_bar
  View.to_buffer "*console: svn diff*"
  View.to_top
  $el.re_search_forward "^Index: #{find}"
  Line.to_left
  $el.recenter(0)
end


16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/xiki/svn.rb', line 16

def self.menu action=nil, *path
  if action == "list"
    orig = View.window
    View.to_after_bar
    out = $el.shell_command_to_string("svn list")
    View.to_window orig
    return out.gsub(/^/, '- ')
  end

  "
  + list/
  + .diff/
  "
end