2 ################################################################################
5 # Description: This script will perform a merge checking for any merge
6 # conflicts and grouping them at the end. This allows the
7 # majority of a large merge to happen and the user can resolve
8 # the conflicts at a later time.
10 # This script also assists in performing binary merges for the
11 # common case. With a binary merge one cannot easily merge the
12 # binary code. Most often it's a sitatution where the user will
13 # either accept the source or the destination binary file as
14 # a whole. In cases where there is only a 2 way merge, this
15 # script offers the user the choice to accept 1 binary file
16 # or the other or to abort this binary merge. Binary merges
17 # conflicts greater than 2 way are not handled.
19 # Author: Andrew@DeFaria.com
20 # Created: Thu Nov 3 10:55:51 PST 2005
23 # (c) Copyright 2005, Andrew@DeFaria.com, all rights reserved
25 ################################################################################
35 my $lib_path = $^O =~ /MSWin/ ? "\\\\brcm-irv\\dfs\\projects\\ccase\\SCM\\lib"
36 : "/projects/ccase/SCM/lib";
38 # Extract relative path and basename from script name.
39 $0 =~ /(.*)[\/\\](.*)/;
41 my $abs_path = (!defined $1) ? "." : File::Spec->rel2abs ($1);
42 $me = (!defined $2) ? $0 : $2;
45 # Remove .pl for Perl scripts that have that extension
48 # Add the appropriate path to our modules to @INC array.
49 unshift @INC, "$abs_path";
50 unshift @INC, $ENV {SITE_PERL_LIBPATH} if defined $ENV {SITE_PERL_LIBPATH};
51 unshift @INC, "$lib_path";
61 display "ERROR: $msg\n" if defined $msg;
63 display "Usage: $me [-u] [-v] [-d] -branch <branch> -path <path(s)>
68 -v: Turn on verbose mode
69 -d: Turn on debug mode
70 -branch Branch to merge from
71 -path: Path to consider (Default .)
83 if ($ARGV [0] eq "-v") {
85 } elsif ($ARGV [0] eq "-d") {
87 } elsif ($ARGV [0] eq "-branch") {
90 Usage "Must specify <branch> after -branch";
94 } elsif ($ARGV [0] eq "-path") {
97 Usage "Must specify <paths> after -path";
99 $path = join (" ", @ARGV);
101 } elsif ($ARGV [0] eq "-u") {
104 Usage "Unknown argument found: " . $ARGV [0];
110 Usage "Must specify a branch" if !defined $branch;
112 Merge $branch, $path, $verbose, $debug;