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
francois (author)
Tue May 13 15:50:32 -0700 2008
commit  f22e7087d60160c403ef851b4e2cad6c16b98ba1
tree    b4cbce8e13583d8dcbf5a8ecde6fc18dbc1252d4
parent  6abfef22b5f739453f64e0db3dac0ee024000c0a
piston / lib / piston / commands / lock_unlock.rb
100644 23 lines (18 sloc) 0.535 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require "piston/commands/base"
 
module Piston
  module Commands
    class LockUnlock < Piston::Commands::Base
      attr_reader :options
 
      def run(wcdir, lock)
        working_copy = guess_wc(wcdir)
        working_copy.validate!
 
        values = working_copy.recall
        values["lock"] = lock
        working_copy.remember(values, values["handler"])
        working_copy.finalize
 
        text = lock ? "Locked" : "Unlocked"
        logger.info "#{text} #{working_copy} against automatic updates"
      end
    end
  end
end