Method: MGit::OperationProgressManager.load_context

Defined in:
lib/m-git/foundation/operation_progress_manager.rb

.load_context(root, type) ⇒ OperationProgressContext,String

加载中间态上下文

Parameters:

  • root (String)

    多仓库根目录

  • type (String)

    自定义Key值,用于索引中间态信息

Returns:



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/m-git/foundation/operation_progress_manager.rb', line 121

def load_context(root, type)
  context = nil
  error = nil
  begin
    MGitConfig.query(root) { |config|
      dict = config[type]
      context = OperationProgressContext.new(type)
      context.deserialize(dict)
    }
  rescue Error => e
    Output.puts_fail_message(e.msg)
    error = e.msg
  end
  return context, error
end