Contents

Class P4::MergeData < Object require "P4"

Description

Class containing the context for an individual merge during execution of a 'p4 resolve'.

Class Methods

None

Instance Methods

your_name their_name base_name your_path their_path base_path result_path merge_hint run_merge
your_name md.your_name() -> aString
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
    
their_name md.their_name() -> aString
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
    
base_name md.base_name() -> aString
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
    
your_path md.your_path() -> aString
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
    
their_path md.their_path() -> aString
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
    
base_path md.base_path() -> aString
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
    
result_path md.result_path() -> aString
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
    
merge_hint md.merge_hint() -> aString
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
    
run_merge md.run_merge() -> aBoolean
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

P4