pvn 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. data/bin/change.rb +50 -0
  2. data/bin/pvn +8 -4
  3. data/bin/quote.rb +18 -6
  4. data/bin/quotes.orig.txt +145 -0
  5. data/bin/quotes.txt +64 -0
  6. data/lib/pvn/app/runner.rb +103 -0
  7. data/lib/pvn/app.rb +1 -142
  8. data/lib/pvn/{subcommands/base → command}/color_option.rb +1 -1
  9. data/lib/pvn/{subcommands/base → command}/command.rb +10 -6
  10. data/lib/pvn/{subcommands/base → command}/doc.rb +2 -2
  11. data/lib/pvn/{subcommands/base → command}/options.rb +2 -2
  12. data/lib/pvn/config.rb +14 -1
  13. data/lib/pvn/{subcommands/diff → diff}/command.rb +6 -6
  14. data/lib/pvn/diff/differ.rb +60 -44
  15. data/lib/pvn/diff/local_differ.rb +99 -0
  16. data/lib/pvn/diff/log_paths.rb +46 -0
  17. data/lib/pvn/{subcommands/diff → diff}/options.rb +8 -6
  18. data/lib/pvn/diff/path.rb +52 -0
  19. data/lib/pvn/diff/path_revision.rb +31 -0
  20. data/lib/pvn/diff/paths.rb +42 -0
  21. data/lib/pvn/diff/repository_differ.rb +154 -0
  22. data/lib/pvn/diff/revision.rb +36 -0
  23. data/lib/pvn/diff/status_paths.rb +87 -0
  24. data/lib/pvn/io/element.rb +29 -8
  25. data/lib/pvn/{subcommands/log → log}/command.rb +4 -4
  26. data/lib/pvn/log/formatter/log_formatter.rb +1 -1
  27. data/lib/pvn/{subcommands/log → log}/options.rb +7 -7
  28. data/lib/pvn/{subcommands/pct → pct}/command.rb +6 -6
  29. data/lib/pvn/{subcommands/pct → pct}/diffcount.rb +1 -1
  30. data/lib/pvn/{subcommands/pct → pct}/differ.rb +2 -2
  31. data/lib/pvn/{subcommands/pct → pct}/local_differ.rb +3 -3
  32. data/lib/pvn/pct/options.rb +12 -0
  33. data/lib/pvn/{subcommands/pct → pct}/repository_differ.rb +5 -13
  34. data/lib/pvn/revision/{entry.rb → argument.rb} +45 -30
  35. data/lib/pvn/{subcommands/revision → revision}/base_option.rb +2 -2
  36. data/lib/pvn/revision/error.rb +11 -0
  37. data/lib/pvn/{subcommands/revision → revision}/multiple_revisions_option.rb +1 -1
  38. data/lib/pvn/revision/range.rb +49 -0
  39. data/lib/pvn/{subcommands/revision → revision}/revision_option.rb +1 -8
  40. data/lib/pvn/{subcommands/revision → revision}/revision_regexp_option.rb +2 -2
  41. data/lib/pvn/{subcommands/status → status}/command.rb +6 -6
  42. data/lib/pvn/status/formatter/status_formatter.rb +1 -1
  43. data/lib/pvn/status/options.rb +12 -0
  44. data/lib/pvn/{base/util.rb → util/array.rb} +2 -1
  45. data/lib/pvn.rb +1 -6
  46. data/lib/svnx/action.rb +52 -0
  47. data/lib/svnx/entries.rb +9 -1
  48. data/lib/svnx/log/command.rb +4 -3
  49. data/lib/svnx/status/entry.rb +30 -13
  50. data/lib/synoption/base_option.rb +10 -27
  51. data/lib/synoption/matchers.rb +22 -0
  52. data/lib/system/command/cachefile.rb +28 -14
  53. data/lib/system/command.rb +1 -1
  54. data/test/integration/pvn/diff/command_test.rb +20 -0
  55. data/test/integration/pvn/diff/local_differ_test.rb +72 -0
  56. data/test/integration/pvn/diff/log_paths_test.rb +28 -0
  57. data/test/integration/pvn/diff/repository_differ_test.rb +127 -0
  58. data/test/integration/pvn/diff/status_paths_test.rb +31 -0
  59. data/test/integration/pvn/log/command_test.rb +29 -0
  60. data/test/integration/pvn/pct/command_test.rb +30 -0
  61. data/test/integration/pvn/status/command_test.rb +26 -0
  62. data/test/unit/pvn/app_test.rb +7 -5
  63. data/test/unit/pvn/diff/path_revision_test.rb +45 -0
  64. data/test/unit/pvn/diff/path_test.rb +38 -0
  65. data/test/unit/pvn/diff/revision_test.rb +35 -0
  66. data/test/unit/pvn/io/element/log/log_test.rb +2 -2
  67. data/test/unit/pvn/log/formatter/entry_formatter_test.rb +40 -29
  68. data/test/unit/pvn/{subcommands/log → log}/options_test.rb +4 -4
  69. data/test/unit/pvn/revision/argument_test.rb +157 -0
  70. data/test/unit/pvn/{subcommands/revision → revision}/multiple_revisions_option_test.rb +10 -11
  71. data/test/unit/pvn/revision/range_test.rb +26 -0
  72. data/test/unit/pvn/{subcommands/revision → revision}/revision_option_test.rb +13 -18
  73. data/test/unit/pvn/{subcommands/revision → revision}/revision_regexp_option_test.rb +8 -10
  74. data/test/unit/svnx/action_test.rb +67 -0
  75. data/test/unit/svnx/info/entries_test.rb +10 -10
  76. data/test/unit/svnx/info/entry_test.rb +7 -10
  77. data/test/unit/svnx/log/entries_test.rb +31 -29
  78. data/test/unit/svnx/log/entry_test.rb +3 -7
  79. data/test/unit/svnx/status/entries_test.rb +7 -6
  80. data/test/unit/svnx/status/entry_test.rb +2 -23
  81. data/test/unit/system/command/cachefile_test.rb +53 -0
  82. data/test/unit/system/command/caching_test.rb +14 -23
  83. metadata +83 -64
  84. data/lib/pvn/describe.rb +0 -40
  85. data/lib/pvn/diff/diffcmd.rb +0 -49
  86. data/lib/pvn/diff/diffopts.rb +0 -58
  87. data/lib/pvn/log/logcmd.rb +0 -135
  88. data/lib/pvn/log/logentry.rb +0 -116
  89. data/lib/pvn/log/logfactory.rb +0 -101
  90. data/lib/pvn/log/logoptions.rb +0 -43
  91. data/lib/pvn/revision.rb +0 -119
  92. data/lib/pvn/subcommands/diff/differ.rb +0 -65
  93. data/lib/pvn/subcommands/diff/local_differ.rb +0 -103
  94. data/lib/pvn/subcommands/diff/repository_differ.rb +0 -145
  95. data/lib/pvn/subcommands/pct/clargs.rb +0 -33
  96. data/lib/pvn/subcommands/pct/options.rb +0 -12
  97. data/lib/pvn/subcommands/status/options.rb +0 -12
  98. data/lib/pvn/svn/command/svncmd.rb +0 -39
  99. data/lib/pvn/svn/environment.rb +0 -23
  100. data/lib/pvn/svn/svnelement.rb +0 -89
  101. data/lib/pvn/svn/svninfo.rb +0 -42
  102. data/lib/pvn/svn/svnroot.rb +0 -29
  103. data/lib/pvn/upp/uppcmd.rb +0 -112
  104. data/lib/pvn/wherecmd.rb +0 -55
  105. data/test/integration/pvn/subcommands/diff/command_test.rb +0 -153
  106. data/test/integration/pvn/subcommands/log/command_test.rb +0 -22
  107. data/test/integration/svnx/log/test.rb +0 -43
  108. data/test/unit/pvn/revision/entry_test.rb +0 -110
  109. /data/lib/pvn/{subcommands/base → command}/clargs.rb +0 -0
  110. /data/lib/pvn/{base → util}/color_formatter.rb +0 -0
  111. /data/lib/pvn/{base → util}/textlines.rb +0 -0
@@ -1,89 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'rubygems'
5
- require 'riel'
6
- require 'pvn/base/util'
7
- require 'pvn/svn/svninfo'
8
-
9
- module PVN
10
- class SVNElement
11
- include Loggable
12
- attr_reader :name
13
-
14
- require 'pvn/svn/svnroot'
15
-
16
- def initialize args
17
- RIEL::Log.info "args: #{args}"
18
-
19
- # $$$ this should handle local paths and full urls.
20
-
21
- # technically, name is what svn info calls "URL"
22
- name = args[:name]
23
- if name.nil? && (fname = args[:filename])
24
- name = fname
25
-
26
- if false
27
- debug "fname : #{fname}"
28
-
29
- fullpath = Pathname.new(fname).expand_path
30
- debug "fullpath: #{fullpath}".yellow
31
-
32
- svnroot = SVNRootElement.new
33
- debug "svnroot: #{svnroot}"
34
- sri = svnroot.info
35
- debug "svnroot.info[:url]: #{sri[:url]}"
36
- debug "svnroot.info[:path]: #{sri[:path]}"
37
- name = svnroot.info[:url] + '/' + fname
38
- debug "name: #{name}"
39
- end
40
- end
41
-
42
- @name = name
43
- RIEL::Log.info "@name: #{@name}".green
44
- end
45
-
46
- def to_command subcmd, revcl, *args
47
- cmd = "svn #{subcmd}"
48
- debug "cmd: #{cmd}"
49
- debug "args: #{args}"
50
- args = args.flatten
51
-
52
- # revcl is [ -r, 3484 ]
53
- if revcl
54
- cmd << " -r #{revcl}"
55
- end
56
- cmd << " " << Util::quote_list(args)
57
- debug "cmd: #{cmd}".cyan
58
- cmd
59
- end
60
-
61
- def info
62
- SVN::Info.new :name => @name
63
- end
64
-
65
- def line_count revision = nil
66
- lc = nil
67
-
68
- cmd = to_command "cat", revision, @name
69
- ::IO.popen cmd do |io|
70
- lc = io.readlines.size
71
- debug "lc: #{lc.inspect}"
72
- end
73
-
74
- lc
75
- end
76
-
77
- def to_s
78
- @name.to_s
79
- end
80
-
81
- def inspect
82
- @name
83
- end
84
-
85
- def <=>(other)
86
- @name <=> other.name
87
- end
88
- end
89
- end
@@ -1,42 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'rubygems'
5
- require 'riel'
6
-
7
- module SVN
8
- # Info has the results of "svn info <file>", where the values returned are
9
- # keys and values in a Hash.
10
- class Info < Hash
11
- include Loggable
12
-
13
- def initialize args
14
- RIEL::Log.info "args: #{args}".green
15
- @name = args[:name]
16
- super()
17
-
18
- execute
19
- end
20
-
21
- def execute
22
- cmd = "svn info #{@name}"
23
- output = %x{#{cmd}}
24
-
25
- kv_re = Regexp.new '^(.*?):\s*(.*)'
26
-
27
- info = Hash.new
28
- output.split("\n").each do |line|
29
- key, value = kv_re.match(line)[1, 2]
30
-
31
- # debug "key: #{key}"
32
- # debug "value: #{value}"
33
-
34
- keysym = key.downcase.gsub(' ', '_').to_sym
35
- # debug "keysym: #{keysym}"
36
-
37
- self[keysym] = value
38
- end
39
- info
40
- end
41
- end
42
- end
@@ -1,29 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'rubygems'
5
- require 'riel'
6
-
7
- module PVN
8
- class SVNRootElement < SVNElement
9
- include Loggable
10
- attr_reader :name
11
-
12
- # returns the topmost directory for the repo root of the given (defaulting
13
- # to current) directory
14
- def self.new dirname = '.'
15
- dir = Pathname.new(dirname).expand_path
16
-
17
- while dir.to_s != '/'
18
- elmt = SVNElement.new :name => dir
19
- elmtinfo = elmt.info
20
- return elmt if elmtinfo[:repository_root] == elmtinfo[:url]
21
- return elmt if !(dir.parent + '.svn').exist?
22
- return nil if elmtinfo[:repository_root].nil?
23
- dir += '..'
24
- end
25
-
26
- nil
27
- end
28
- end
29
- end
@@ -1,112 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'system/command'
5
-
6
- module PVN
7
- class UppOptionSet < OptionSet
8
- attr_accessor :revision
9
-
10
- def initialize
11
- super
12
- # @revision = add RevisionOption.new
13
- end
14
- end
15
-
16
- class UppCommand < Command
17
- DEFAULT_LIMIT = 5
18
- COMMAND = "upp"
19
-
20
- self.doc do |doc|
21
- doc.subcommands = [ COMMAND ]
22
- doc.description = "Updates the local repository, in parallel for speed."
23
- doc.usage = ""
24
- doc.summary = [ "Updates the local repository, using parallel tasks. This is",
25
- "signficantly faster () for projects with multiple",
26
- "subprojects defined as externals." ]
27
- doc.examples << [ "pvn upp", "Updates the local repository." ]
28
- end
29
-
30
- def initialize args
31
- # insanely simple
32
-
33
- externals = get_all_externals
34
-
35
- upcmds = Array.new
36
- externals.each do |ext|
37
- puts "ext: #{ext}"
38
- upcmds << "cd #{ext} && svn up 2>&1"
39
- end
40
-
41
- upcmds << "svn up --ignore-externals . 2>&1"
42
-
43
- cmds_to_threads = upcmds.map do |upcmd|
44
- thr = Thread.new do
45
- IO.popen(upcmd) do |io|
46
- io.readlines
47
- end
48
- end
49
- [ upcmd, thr ]
50
- end
51
-
52
- cmds_to_threads.each do |cmd, thread|
53
- puts cmd
54
- puts thread.value
55
- end
56
- end
57
-
58
- def external_to_local fd, line
59
- # spaces?
60
- local, url = line.split
61
-
62
- # I've seen externals defined "backwards" (local url)
63
- if local.index(%r{\w+://})
64
- url, local = local, url
65
- end
66
-
67
- fd + "/" + local
68
- end
69
-
70
- def get_externals fd
71
- externals = Array.new
72
- pgcmd = "svn pg #{fd}"
73
- IO.popen(pgcmd) do |io|
74
- io.each do |line|
75
- next if line.strip.empty?
76
-
77
- # spaces?
78
- local, url = line.split
79
-
80
- # I've seen externals defined "backwards" (local url)
81
- if local.index(%r{\w+://})
82
- url, local = local, url
83
- end
84
-
85
- externals << "#{fd}/#{local}"
86
- end
87
- end
88
-
89
- externals
90
- end
91
-
92
- def get_all_externals
93
- externals = Array.new
94
-
95
- # get properties list (this could probably be cached, but it's relatively fast)
96
- proplistcmd = "svn pl -R"
97
- fd = nil
98
- fdre = Regexp.new '^Properties on \'(.*)\':$'
99
- extre = Regexp.new '^\s*svn:externals$'
100
- IO.popen(proplistcmd) do |io|
101
- io.each do |line|
102
- if md = fdre.match(line)
103
- fd = md[1]
104
- elsif fd && extre.match(line)
105
- externals.concat get_externals(fd)
106
- end
107
- end
108
- end
109
- externals
110
- end
111
- end
112
- end
data/lib/pvn/wherecmd.rb DELETED
@@ -1,55 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'rubygems'
5
- require 'riel'
6
- require 'system/command'
7
- require 'pvn/io/fselement'
8
- require 'pvn/svn/svnelement'
9
- require 'pvn/svn/svnroot'
10
- require 'pvn/io/element'
11
-
12
- module PVN
13
- class WhereOptionSet < OptionSet
14
- attr_accessor :revision
15
-
16
- def initialize
17
- super
18
- # @revision = add RevisionRegexpOption.new
19
- end
20
- end
21
-
22
- class WhereCommand < Command
23
- DEFAULT_LIMIT = 5
24
- COMMAND = "where"
25
-
26
- self.doc do |doc|
27
- doc.subcommands = [ COMMAND ]
28
- doc.description = "Shows the Subversion mapping from the given URL or file."
29
- doc.usage = "[OPTIONS] [FILE|URL]..."
30
- doc.summary = [ "Shows the Subversion mapping from the URL or file. If the ",
31
- "argument is a URL, then the local file/directory is displayed.",
32
- "If the argument is a file, then the URL for the Subversion",
33
- "repository is printed." ]
34
- # doc.examples << [ "pvn pct main.c", "Prints the number of lines and percentage by which main.c has changed." ]
35
- end
36
-
37
- def initialize args
38
- # not calling super, since all of our stuff goes on in this ctor.
39
-
40
- args[:command_args].each do |arg|
41
- info "arg: #{arg}".on_black
42
-
43
- if arg.index(%r{^\w+:\/\/})
44
- info "url: #{arg}".on_red
45
- else
46
- info "file: #{arg}".red
47
- el = Element.new :file => arg
48
- info "el: #{el}"
49
- info "el.local: #{el.local}"
50
- info "el.svn: #{el.svn}"
51
- end
52
- end
53
- end
54
- end
55
- end
@@ -1,153 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'tc'
5
- require 'pvn/subcommands/diff/command'
6
- require 'resources'
7
- require 'stringio'
8
-
9
- module PVN::Subcommands::Diff
10
- class CommandTest < PVN::TestCase
11
-
12
- def assert_arrays_equal expected, actual
13
- (0 ... [ expected.size, actual.size ].max).each do |idx|
14
- assert_equal expected[idx], actual[idx]
15
- end
16
- end
17
-
18
- def assert_diff_command args, explines
19
- orig_dir = Dir.pwd
20
-
21
- Dir.chdir '/Programs/wiquery/trunk'
22
-
23
- strio = StringIO.new
24
-
25
- $io = strio
26
-
27
- dc = Command.new args
28
- info "dc: #{dc}".yellow
29
-
30
- strio.close
31
- # puts strio.string
32
-
33
- actlines = strio.string.split("\n")
34
-
35
- assert_arrays_equal explines, actlines
36
-
37
- $io = $stdout
38
- Dir.chdir orig_dir
39
- end
40
-
41
- def test_local_to_head
42
- explines = Array.new
43
-
44
- explines << "Index: AddedFile.txt"
45
- explines << "==================================================================="
46
- explines << "--- AddedFile.txt (revision 0)"
47
- explines << "+++ AddedFile.txt (revision 0)"
48
- explines << "@@ -0,0 +1,17 @@"
49
- explines << "+THE KNIGHT'S TALE"
50
- explines << "+WHILOM, as olde stories tellen us,"
51
- explines << "+There was a duke that highte Theseus. was called"
52
- explines << "+Of Athens he was lord and governor,"
53
- explines << "+And in his time such a conqueror"
54
- explines << "+That greater was there none under the sun."
55
- explines << "+Full many a riche country had he won."
56
- explines << "+What with his wisdom and his chivalry,"
57
- explines << "+He conquer'd all the regne of Feminie,"
58
- explines << "+That whilom was y-cleped Scythia;"
59
- explines << "+And weddede the Queen Hippolyta"
60
- explines << "+And brought her home with him to his country"
61
- explines << "+With muchel glory and great solemnity,"
62
- explines << "+And eke her younge sister Emily,"
63
- explines << "+And thus with vict'ry and with melody"
64
- explines << "+Let I this worthy Duke to Athens ride,"
65
- explines << "+And all his host, in armes him beside."
66
- explines << "Index: LICENSE"
67
- explines << "==================================================================="
68
- explines << "--- LICENSE (revision 1950)"
69
- explines << "+++ LICENSE (working copy)"
70
- explines << "@@ -1,19 +0,0 @@"
71
- explines << "-Copyright (c) 2009 WiQuery team"
72
- explines << "-"
73
- explines << "-Permission is hereby granted, free of charge, to any person obtaining a copy"
74
- explines << "-of this software and associated documentation files (the \"Software\"), to deal"
75
- explines << "-in the Software without restriction, including without limitation the rights"
76
- explines << "-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell"
77
- explines << "-copies of the Software, and to permit persons to whom the Software is"
78
- explines << "-furnished to do so, subject to the following conditions:"
79
- explines << "-"
80
- explines << "-The above copyright notice and this permission notice shall be included in"
81
- explines << "-all copies or substantial portions of the Software."
82
- explines << "-"
83
- explines << "-THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR"
84
- explines << "-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,"
85
- explines << "-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE"
86
- explines << "-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER"
87
- explines << "-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,"
88
- explines << "-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN"
89
- explines << "-THE SOFTWARE."
90
- # because we're reading the lines, then puts-ing them, each line gets a "\n"
91
- # explines << ""
92
- explines << "Index: pom.xml"
93
- explines << "==================================================================="
94
- explines << "--- pom.xml (revision 1950)"
95
- explines << "+++ pom.xml (working copy)"
96
- explines << "@@ -7,7 +7,7 @@"
97
- explines << " <packaging>pom</packaging>"
98
- explines << " <version>1.5-SNAPSHOT</version>"
99
- explines << " <name>WiQuery Parent</name>"
100
- explines << "-"
101
- explines << "+ <!-- inserted comment -->"
102
- explines << " <scm>"
103
- explines << " <developerConnection>scm:svn:https://wiquery.googlecode.com/svn/branches/wicket-1.5</developerConnection>"
104
- explines << " </scm>"
105
- explines << "Index: wiquery-core/src/main/java/org/odlabs/wiquery/core/effects/EffectBehavior.java"
106
- explines << "==================================================================="
107
- explines << "--- wiquery-core/src/main/java/org/odlabs/wiquery/core/effects/EffectBehavior.java (revision 1950)"
108
- explines << "+++ wiquery-core/src/main/java/org/odlabs/wiquery/core/effects/EffectBehavior.java (working copy)"
109
- explines << "@@ -38,7 +38,6 @@"
110
- explines << " */"
111
- explines << " public class EffectBehavior extends WiQueryAbstractBehavior"
112
- explines << " {"
113
- explines << "-"
114
- explines << " private static final long serialVersionUID = 3597955113451275208L;"
115
- explines << " "
116
- explines << " /**"
117
- explines << "@@ -49,17 +48,19 @@"
118
- explines << " /**"
119
- explines << " * Builds a new instance of {@link EffectBehavior}."
120
- explines << " */"
121
- explines << "- public EffectBehavior(Effect effect)"
122
- explines << "- {"
123
- explines << "- super();"
124
- explines << "+ public EffectBehavior(Effect effect) {"
125
- explines << " this.effect = effect;"
126
- explines << " }"
127
- explines << " "
128
- explines << "+ public void newMethod() {"
129
- explines << "+ // a new method"
130
- explines << "+ }"
131
- explines << "+"
132
- explines << " @Override"
133
- explines << " public JsStatement statement()"
134
- explines << " {"
135
- explines << "- JsQuery query = new JsQuery(getComponent());"
136
- explines << "- query.$().chain(this.effect);"
137
- explines << "- return query.getStatement();"
138
- explines << "+ JsQuery queryx = new JsQuery(getComponent());"
139
- explines << "+ queryx.$().chain(this.effect);"
140
- explines << "+ return queryx.getStatement();"
141
- explines << " }"
142
- explines << " }"
143
-
144
- assert_diff_command %w{ }, explines
145
- end
146
-
147
- def test_remote
148
- explines = Array.new
149
-
150
- assert_diff_command %w{ -r923:926 }, explines
151
- end
152
- end
153
- end
@@ -1,22 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'tc'
5
- require 'pvn/subcommands/log/command'
6
-
7
- module PVN; module App; module Log; end; end; end
8
-
9
- module PVN::App::Log
10
- class CommandTest < PVN::TestCase
11
-
12
- def test_path
13
- PVN::Subcommands::Log::Command.new %w{ /Programs/wiquery/trunk/pom.xml }
14
- end
15
-
16
- def test_invalid_path
17
- assert_raises(RuntimeError) do
18
- PVN::Subcommands::Log::Command.new %w{ /this/doesnt/exist }
19
- end
20
- end
21
- end
22
- end
@@ -1,43 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'integration/tc'
5
- require 'svnx/log/tc'
6
- require 'svnx/log/command'
7
- require 'svnx/log/entry'
8
-
9
- module SVNx::Log
10
- class EntryTestCase < PVN::IntegrationTestCase
11
- include Loggable
12
-
13
- def assert_log_entry_equals entry, expdata
14
- assert_equal expdata[0], entry.revision
15
- assert_equal expdata[1], entry.author
16
- assert_equal expdata[2], entry.date
17
- assert_equal expdata[3], entry.message
18
- entry.paths.each_with_index do |path, idx|
19
- info path.inspect.yellow
20
- assert_equal expdata[4 + idx][:kind], path.kind
21
- assert_equal expdata[4 + idx][:action], path.action
22
- assert_equal expdata[4 + idx][:name], path.name
23
- end
24
- end
25
-
26
- def test_entry_from_command
27
- lcargs = SVNx::LogCommandArgs.new :limit => 2, :verbose => false, :use_cache => false
28
- lc = SVNx::LogCommand.new lcargs
29
-
30
- lc.execute
31
- output = lc.output
32
- # info "output: #{output}"
33
-
34
- expdata = '1947', 'reiern70', '2011-11-14T12:24:45.757124Z', 'added a convenience method to set the range'
35
- expdata << { :kind => 'file', :action => 'M', :name => '/trunk/wiquery-jquery-ui/src/test/java/org/odlabs/wiquery/ui/slider/SliderTestCase.java' }
36
-
37
- doc = REXML::Document.new output.join('')
38
-
39
- entry = Entry.new :xmlelement => doc.elements[1].elements[2]
40
- assert_log_entry_equals entry, expdata
41
- end
42
- end
43
- end
@@ -1,110 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- ruby -*-
3
-
4
- require 'tc'
5
- require 'svnx/log/entries'
6
- require 'pvn/revision/entry'
7
-
8
- require 'resources'
9
-
10
- module PVN::Revision
11
- class TestCase < PVN::TestCase
12
- def setup
13
- @xmllines = Resources::WIQTR_LOG_POM_XML.readlines
14
- end
15
-
16
- def assert_revision_entry exp_value, value
17
- rev = PVN::Revision::Entry.new :xmllines => @xmllines, :value => value
18
- assert_equal exp_value, rev.value
19
- end
20
-
21
- def assert_revision_entry_raises value
22
- assert_raises(PVN::Revision::RevisionError) do
23
- assert_revision_entry nil, value
24
- end
25
- end
26
-
27
- def test_absolute_midrange
28
- assert_revision_entry 733, 733
29
- end
30
-
31
- def test_absolute_most_recent
32
- assert_revision_entry 1907, 1907
33
- end
34
-
35
- def test_absolute_least_recent
36
- assert_revision_entry 412, 412
37
- end
38
-
39
- def test_absolute_midrange_as_string
40
- assert_revision_entry 733, '733'
41
- end
42
-
43
- def test_absolute_most_recent_as_string
44
- assert_revision_entry 1907, '1907'
45
- end
46
-
47
- def test_absolute_least_recent_as_string
48
- assert_revision_entry 412, '412'
49
- end
50
-
51
- def test_svn_word
52
- assert_revision_entry 'HEAD', 'HEAD'
53
- %w{ HEAD BASE COMMITTED PREV }.each do |word|
54
- assert_revision_entry word, word
55
- end
56
- end
57
-
58
- def test_negative_most_recent
59
- assert_revision_entry 1907, -1
60
- end
61
-
62
- def test_negative_second_most_recent
63
- assert_revision_entry 1887, -2
64
- end
65
-
66
- def test_negative_least_recent
67
- assert_revision_entry 412, -34
68
- end
69
-
70
- def test_negative_too_far_back
71
- assert_revision_entry_raises(-35)
72
- end
73
-
74
- def test_negative_most_recent_as_string
75
- assert_revision_entry 1907, '-1'
76
- end
77
-
78
- def test_negative_second_most_recent_as_string
79
- assert_revision_entry 1887, '-2'
80
- end
81
-
82
- def test_negative_least_recent_as_string
83
- assert_revision_entry 412, '-34'
84
- end
85
-
86
- def test_negative_too_far_back_as_string
87
- assert_revision_entry_raises '-35'
88
- end
89
-
90
- def test_positive_most_recent
91
- assert_revision_entry 1907, '+34'
92
- end
93
-
94
- def test_positive_second_most_recent
95
- assert_revision_entry 1887, '+33'
96
- end
97
-
98
- def test_positive_least_recent
99
- assert_revision_entry 412, '+1'
100
- end
101
-
102
- def test_positive_too_far_forward
103
- assert_revision_entry_raises '+35'
104
- end
105
-
106
- def xxxtest_range_svn_word_to_number
107
- assert_revision_entry 'BASE:1', 'BASE:1'
108
- end
109
- end
110
- end
File without changes
File without changes
File without changes