forked from SHYFEM-model/shyfem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
g u
committed
Apr 15, 2020
1 parent
90f9973
commit 0614fc8
Showing
100 changed files
with
1,128 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env bash | ||
#!/bin/bash | ||
|
||
#------------------------------------------------------------------------ | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
#!/bin/sh | ||
|
||
#------------------------------------------------------------------------ | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
#!/bin/sh | ||
|
||
#------------------------------------------------------------------------ | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# | ||
#!/bin/sh | ||
|
||
#------------------------------------------------------------------------ | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/usr/bin/perl | ||
# | ||
# automerges merge conflicts | ||
# | ||
#----------------------------------------------------------- | ||
|
||
my $file = $ARGV[0]; | ||
|
||
$debug = 0; | ||
|
||
$start="<<<<<<< HEAD"; | ||
$end=">>>>>>>"; | ||
$mid="======="; | ||
|
||
$sep="============================================================"; | ||
|
||
print STDERR "handling file $file\n" if $debug; | ||
|
||
while(<>) { | ||
|
||
if( /^$start$/ ) { | ||
$block++; | ||
$in_first = 1; | ||
next; | ||
} elsif( /^$mid$/ ) { | ||
if( not $in_first ) { | ||
die "*** error reading mid but not in first: $_"; | ||
} | ||
$in_first = 0; | ||
$in_second = 1; | ||
next; | ||
} elsif( /^$end / ) { | ||
if( not $in_second ) { | ||
die "*** error reading end but not in second: $_"; | ||
} | ||
$in_second = 0; | ||
handle_blocks(); | ||
next; | ||
} | ||
|
||
if( $in_first ) { | ||
push(@first,$_); | ||
} elsif( $in_second ) { | ||
push(@second,$_); | ||
} else { | ||
print; | ||
} | ||
} | ||
|
||
print STDERR "finished handling file $file with $block blocks(s)\n" if $debug; | ||
|
||
#----------------------------------------------------------- | ||
|
||
sub handle_blocks | ||
{ | ||
my $ftime = get_time(@first); | ||
my $stime = get_time(@second); | ||
|
||
#print STDERR "first: $ftime second: $stime\n"; | ||
|
||
if( $ftime < $stime ) { | ||
my @aux = @second; @second = @first; @first = @aux; | ||
} | ||
|
||
print_block(@first); | ||
print_sep(); | ||
print_block(@second); | ||
|
||
@first = (); @second = (); | ||
} | ||
|
||
sub print_block | ||
{ | ||
foreach (@_) { | ||
print; | ||
} | ||
} | ||
|
||
sub print_sep | ||
{ | ||
if( $file eq "VERSION" ) { | ||
die "*** can handle only one block\n" if( $block > 1 ); | ||
print "\n"; | ||
} elsif( $file eq "COMMIT" ) { | ||
die "*** can handle only one block\n" if( $block > 1 ); | ||
print "\n$sep\n\n"; | ||
} elsif( $file eq "fem3d/subver.f" ) { | ||
@second = (); #we only need the first occurrence, no seperator | ||
} else { | ||
die "*** cannot handle file: $file\n"; | ||
} | ||
} | ||
|
||
sub get_time | ||
{ | ||
my $date = shift; | ||
|
||
chomp($date); | ||
|
||
if( $file eq "VERSION" ) { | ||
$date =~ s/^.*commit_//; | ||
} elsif( $file eq "COMMIT" ) { | ||
; | ||
} elsif( $file eq "fem3d/subver.f" ) { | ||
$date =~ s/^.*(\d{4}-\d{2}-\d{2}).\s*$/$1/; | ||
} else { | ||
die "*** cannot handle file: $file\n"; | ||
} | ||
|
||
print STDERR "date found: $date\n" if $debug; | ||
my $secs = `date -d "$date" +%s`; | ||
|
||
return $secs; | ||
} | ||
|
||
#----------------------------------------------------------- | ||
|
Oops, something went wrong.