Contents
Class
P4::MergeData
< Object
|
require
"P4"
|
Description
Class containing the context for an individual merge during execution
of a 'p4 resolve'.
Returns the name of 'your' file in the merge. This is typically
a path to a file in the workspace.
p4.run_resolve() do
|md|
yours = md.your_name
md.merge_hint
end
Returns the name of 'their' file in the merge. This is typically
a path to a file in the depot.
p4.run_resolve() do
|md|
theirs = md.their_name
md.merge_hint
end
Returns the name of the 'base' file in the merge. This is typically
a path to a file in the depot.
p4.run_resolve() do
|md|
base = md.base_name
md.merge_hint
end
Returns the path of 'your' file in the merge. This is typically
a path to a file in the workspace.
p4.run_resolve() do
|md|
your_path = md.your_path
md.merge_hint
end
Returns the path of 'their' file in the merge. This is typically
a path to a temporary file on your local machine in which the contents
of
their_name() have been loaded.
p4.run_resolve() do
|md|
their_name = md.their_name
their_file = File.open( md.their_path )
md.merge_hint
end
Returns the path of the base file in the merge. This is typically
a path to a temporary file on your local machine in which the contents
of
base_name() have been loaded.
p4.run_resolve() do
|md|
base_name = md.base_name
base_file = File.open( md.base_path )
md.merge_hint
end
Returns the path to the merge result. This is typically a path to a
temporary file on your local machine in which the contents
of the automatic merge performed by the server have been loaded.
p4.run_resolve() do
|md|
result_file = File.open( md.result_path )
md.merge_hint
end
Returns the hint from the server as to how it thinks you
might best resolve this merge.
p4.run_resolve() do
|md|
md.merge_hint
end
If the environment variable P4MERGE is defined, run_merge()
invokes the specified program and returns a boolean based on
the return value of that program.
p4.run_resolve() do
|md|
if ( ENV.has_key?( "P4MERGE" ) && md.run_merge() )
"am"
else
"s"
end
end
See Also