lib/capistrano/recipes/deploy/scm/accurev.rb
# Given an Accurev revision identifier, this method returns an identifier that
# can be used for later SCM calls. This returned identifier will not
# change as a result of further SCM activity.
Given an Accurev revision identifier, this method returns an identifier that
can be used for later SCM calls. This returned identifier will not
change as a result of further SCM activity.
Given an Accurev revision identifier this method returns an identifier that can be used for later SCM calls . This returned identifier will not change as a result of further SCM activity .
def query_revision(revision)
          internal_revision = InternalRevision.parse(revision)
          return revision unless internal_revision.psuedo_revision?
          logger.debug("Querying for real revision for #{internal_revision}")
          rev_stream = internal_revision.stream
          logger.debug("Determining what type of stream #{rev_stream} is...")
          stream_xml = yield show_streams_for(rev_stream)
          stream_doc = Document.new(stream_xml)
          type = XPath.first(stream_doc, '//streams/stream/@type').value
          case type
          when 'snapshot'
            InternalRevision.new(rev_stream, 'highest').to_s
          else
            logger.debug("Getting latest transaction id in #{rev_stream}")
            hist_xml = yield scm(:hist, '-ftx', '-s', rev_stream, '-t', 'now.1')
            hist_doc = Document.new(hist_xml)
            transaction_id = XPath.first(hist_doc, '//AcResponse/transaction/@id').value
            InternalRevision.new(stream, transaction_id).to_s
          end
        end
def query_revision ( revision ) internal_revision = InternalRevision . parse ( revision ) return revision unless internal_revision . psuedo_revision? logger . debug ( "Querying for real revision for #{internal_revision}" ) rev_stream = internal_revision . stream logger . debug ( "Determining what type of stream #{rev_stream} is..." ) stream_xml = yield show_streams_for ( rev_stream ) stream_doc = Document . new ( stream_xml ) type = XPath . first ( stream_doc , '//streams/stream/@type' ) . value case type when 'snapshot' InternalRevision . new ( rev_stream , 'highest' ) . to_s else logger . debug ( "Getting latest transaction id in #{rev_stream}" ) hist_xml = yield scm ( :hist , '-ftx' , '-s' , rev_stream , '-t' , 'now.1' ) hist_doc = Document . new ( hist_xml ) transaction_id = XPath . first ( hist_doc , '//AcResponse/transaction/@id' ) . value InternalRevision . new ( stream , transaction_id ) . to_s end end
Given an Accurev revision identifier, this method returns an identifier that
can be used for later SCM calls.
Given an Accurev revision identifier this method returns an identifier that can be used for later SCM calls .
# Doing another yield for a second Accurev call. Hopefully this is ok.
revision
<not_specific>