public
Description: Piston is a utility that eases vendor branch management. This repository is a complete reimplementation of Piston to provide different backends, depending on the repositories and working copies you pistonize from.
Homepage: http://piston.rubyforge.org/
Clone URL: git://github.com/francois/piston.git
Search Repo:
Made the info command much simpler: simply output the #to_yaml version of 
the recalled values.

This is essentially doing doing `cat #{WC_PATH}/.piston.yml`.
francois (author)
Tue May 13 15:28:54 -0700 2008
commit  a7c46c702243f145a4089b0cb33d189870f1ae52
tree    2ce0de09b494e5135e0764e8cf450b58406d0317
parent  ae858b7b7efd66d57d7d8e5dff01e2483013269e
...
109
110
111
 
112
113
114
115
116
117
118
119
120
121
122
123
124
 
125
126
127
...
109
110
111
112
113
 
 
 
 
 
 
 
 
 
 
 
 
114
115
116
117
0
@@ -109,19 +109,9 @@
0
       logger.debug {"Finalizing #{path}"}
0
     end
0
     
0
+ # Returns basic information about this working copy.
0
     def info
0
- values = recall
0
- result = []
0
- result << "+---------------------------Piston Info----------------------------------+"
0
- result << "Directory: #{path}"
0
- values["repository_class"] =~ /Piston::(.*)::Repository/
0
- result << "Repository type: #{$1}"
0
- result << "Repository: #{values["repository_url"]}"
0
- result << "Commit: #{values["handler"]["commit"]}" if values["handler"]["commit"]
0
- result << "Remote Revision: #{values["handler"]["piston:remote-revision"]}" if values["handler"]["piston:remote-revision"]
0
- result << "Lock: #{values["lock"]}"
0
- result << "+------------------------------------------------------------------------+"
0
- result.join("\n")
0
+ recall
0
     end
0
     
0
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
 
16
17
18
19
20
 
 
 
21
22
23
24
25
26
27
28
29
...
1
2
3
 
 
 
 
 
4
 
 
 
 
 
 
5
6
7
8
 
 
 
9
10
11
12
 
 
 
 
 
 
 
13
0
@@ -1,30 +1,14 @@
0
 require File.dirname(__FILE__) + "/../../test_helper"
0
 
0
 class TestWorkingCopyInfo < Test::Unit::TestCase
0
-
0
- GIT_VALUES = {"format"=>1, "handler"=>{"commit"=>"db9c7bddaa9c54bff48d64c56db2f89b2bcfa049"}, "repository_url"=>"git://gitorious.org/git-tmbundle/mainline.git", "lock"=>false, "repository_class"=>"Piston::Git::Repository"}
0
- SVN_VALUES = {"format"=>1, "handler"=>{"piston:remote-revision"=>9250, "piston:uuid"=>"5ecf4fe2-1ee6-0310-87b1-e25e094e27de"}, "repository_url"=>"http://dev.rubyonrails.org/svn/rails/plugins/ssl_requirement", "lock"=>nil, "repository_class"=>"Piston::Svn::Repository"}
0
-
0
-
0
   def setup
0
-
0
- wcdir = Pathname.new("tmp/wc")
0
- wcdir.rmtree rescue nil
0
- wcdir.mkpath
0
- @wc = Piston::WorkingCopy.new(wcdir)
0
-
0
+ @path = Pathname.new("tmp/wc")
0
+ @wc = Piston::WorkingCopy.new(@path)
0
   end
0
   
0
- def test_info_when_is_git_repository
0
- @wc.expects(:recall).returns(GIT_VALUES)
0
- assert_equal "+---------------------------Piston Info----------------------------------+\nDirectory: tmp/wc\nRepository type: Git\nRepository: git://gitorious.org/git-tmbundle/mainline.git\nCommit: db9c7bddaa9c54bff48d64c56db2f89b2bcfa049\nLock: false\n+------------------------------------------------------------------------+", @wc.info
0
+ def test_info_recalls_values
0
+ @wc.expects(:recall).returns(values = mock("recalled values"))
0
+ assert_equal values, @wc.info
0
   end
0
-
0
- def test_info_when_is_svn_repository
0
- @wc.expects(:recall).returns(SVN_VALUES)
0
- assert_equal "+---------------------------Piston Info----------------------------------+\nDirectory: tmp/wc\nRepository type: Svn\nRepository: http://dev.rubyonrails.org/svn/rails/plugins/ssl_requirement\nRemote Revision: 9250\nLock: \n+------------------------------------------------------------------------+", @wc.info
0
- end
0
-
0
-
0
 end

Comments

    No one has commented yet.