Class RSCM::Darcs
In: lib/rscm/scm/darcs.rb
Parent: Base

Methods

Attributes

Public Class methods

[Source]

    # File lib/rscm/scm/darcs.rb, line 19
19:     def initialize(dir=".")
20:       @dir = File.expand_path(dir)
21:     end

Public Instance methods

[Source]

    # File lib/rscm/scm/darcs.rb, line 59
59:     def add(relative_filename)
60:       with_working_dir(@checkout_dir) do
61:         darcs("add #{relative_filename}")
62:       end
63:     end

[Source]

    # File lib/rscm/scm/darcs.rb, line 23
23:     def can_create_central?
24:       true
25:     end

[Source]

    # File lib/rscm/scm/darcs.rb, line 65
65:     def checked_out?
66:       File.exists?("#{@checkout_dir}/_darcs")
67:     end

[Source]

    # File lib/rscm/scm/darcs.rb, line 48
48:     def commit(message)
49:       logfile = Tempfile.new("darcs_logfile")
50:       logfile.print("something nice\n")
51:       logfile.print(message + "\n")
52:       logfile.close
53: 
54:       with_working_dir(@checkout_dir) do
55:         darcs("record --all --logfile #{PathConverter.filepath_to_nativepath(logfile.path, false)}")
56:       end
57:     end

[Source]

    # File lib/rscm/scm/darcs.rb, line 27
27:     def create_central
28:       with_working_dir(@dir) do
29:         darcs("initialize")
30:       end
31:     end

[Source]

    # File lib/rscm/scm/darcs.rb, line 33
33:     def import_central(dir, message)
34:       ENV["EMAIL"] = "dcontrol@codehaus.org"
35:       FileUtils.cp_r(Dir.glob("#{dir}/*"), @dir)
36:       with_working_dir(@dir) do
37:         darcs("add --recursive .")
38:         
39:         logfile = Tempfile.new("darcs_logfile")
40:         logfile.print("something nice\n")
41:         logfile.print(message + "\n")
42:         logfile.close
43:         
44:         darcs("record --all --logfile #{PathConverter.filepath_to_nativepath(logfile.path, false)}")
45:       end
46:     end

[Source]

    # File lib/rscm/scm/darcs.rb, line 10
10:     def installed?
11:       begin
12:         darcs("--version", {}) 
13:         true
14:       rescue
15:         false
16:       end
17:     end

[Source]

    # File lib/rscm/scm/darcs.rb, line 87
87:     def revisions(from_identifier, to_identifier=Time.infinity)
88:       from_identifier = Time.epoch if from_identifier.nil?
89:       to_identifier = Time.infinity if to_identifier.nil?
90:       with_working_dir(@checkout_dir) do
91:         darcs("changes --summary --xml-output") do |stdout|
92:           DarcsLogParser.new.parse_revisions(stdout, from_identifier, to_identifier)
93:         end
94:       end
95:     end

[Source]

    # File lib/rscm/scm/darcs.rb, line 97
97:     def supports_trigger?
98:       true
99:     end

[Source]

    # File lib/rscm/scm/darcs.rb, line 69
69:     def uptodate?(from_identifier)
70:       if (!checked_out?(@checkout_dir))
71:         false
72:       else
73:         with_working_dir(@checkout_dir) do
74:           darcs("pull --dry-run #{@dir}") do |io|
75:             io.each_line do |line|
76:               if (line =~ /No remote changes to pull in!/)
77:                 true
78:               else
79:                 false
80:               end
81:             end
82:           end
83:         end
84:       end
85:     end

Protected Instance methods

[Source]

     # File lib/rscm/scm/darcs.rb, line 103
103:     def checkout_silent(to_identifier) # :yield: file

104:       with_working_dir(File.dirname(checkout_dir)) do
105:         darcs("get --repo-name #{File.basename(checkout_dir)} #{@dir}")
106:       end
107:     end

[Source]

     # File lib/rscm/scm/darcs.rb, line 109
109:     def ignore_paths
110:       return [/_darcs/]
111:     end

[Validate]