GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
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
francois (author)
Fri May 09 07:47:05 -0700 2008
commit  46ed4501e7a9620227373fe600b8124d582daaf9
tree    a57b89adfc57dbb7fe49f32ef0595b4aade24825
parent  24c8b6fae1e43014a140a04e0fbfd97efee866f9
piston / lib / piston / commands / lock_unlock.rb
100644 20 lines (16 sloc) 0.51 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "piston/commands/base"
 
module Piston
  module Commands
    class LockUnlock < Piston::Commands::Base
      attr_reader :options
 
      def run(lock)
        working_copy = Piston::WorkingCopy.guess(options[:wcdir])
        raise Piston::WorkingCopy::NotWorkingCopy if !working_copy.exist? || !working_copy.pistonized?
 
        values = working_copy.recall
        values["lock"] = lock
        working_copy.remember(values, values["handler"])
        working_copy.finalize
      end
    end
  end
end