2 ################################################################################
5 # Description: This script will perform a rebase 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 ################################################################################
31 my ($me, $SEPARATOR, $NULL);
34 my ($abs_path, $lib_path);
36 # Extract relative path and basename from script name.
37 $0 =~ /(.*)[\/\\](.*)/;
39 $abs_path = (!defined $1) ? "." : File::Spec->rel2abs ($1);
40 $me = (!defined $2) ? $0 : $2;
43 # Remove .pl for Perl scripts that have that extension
46 # Define the path SEPARATOR
47 $SEPARATOR = ($^O =~ /MSWin/) ? "\\" : "/";
48 $NULL = ($^O =~ /MSWin/) ? "NUL" : "/dev/null";
51 $lib_path = "$abs_path" . $SEPARATOR . ".." . $SEPARATOR . "lib";
53 # Add the appropriate path to our modules to @INC array.
54 unshift (@INC, "$abs_path");
55 unshift (@INC, "$lib_path");
65 display "ERROR: $msg\n" if defined $msg;
67 display "Usage: $me [-u] [-v] [-d] -view <viewtag>
68 { -recommended | -baseline <baseline> }
73 -v: Turn on verbose mode
74 -d: Turn on debug mode
75 -recommended: Rebase from recommended baselines
76 -baseline: Rebase from this baseline
86 if ($ARGV [0] eq "-v") {
88 } elsif ($ARGV [0] eq "-d") {
90 } elsif ($ARGV [0] eq "-recommended") {
91 # Nothing to do, leave $baseline undefined
92 } elsif ($ARGV [0] eq "-baseline") {
95 Usage "Must specify <baseline> after -baseline";
97 $baseline = $ARGV [0];
99 } elsif ($ARGV [0] eq "-u") {
102 Usage "Unknown argument found: " . $ARGV [0];
108 Rebase $baseline, $verbose, $debug;