# HG changeset patch # User Alpar Juttner # Date 2009-04-27 12:24:44 # Node ID a76f55d7d39765d686149fec07c3bf60f595f403 # Parent 47b376a5a2a73ad12f576fa5a8e5f40196216dd1 unify-sources.sh refresh the dates according to the last modification diff --git a/scripts/unify-sources.sh b/scripts/unify-sources.sh --- a/scripts/unify-sources.sh +++ b/scripts/unify-sources.sh @@ -1,8 +1,17 @@ #!/bin/bash -YEAR=`date +2003-%Y` +YEAR=`date +%Y` HGROOT=`hg root` +function hg_year() { + if [ -n "$(hg st $1)" ]; then + echo $YEAR + else + hg log -l 1 --template='{date|isodate}\n' $1 | + cut -d '-' -f 1 + fi +} + function update_header() { TMP_FILE=`mktemp` FILE_NAME=$1 @@ -11,7 +20,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) "$YEAR" + * Copyright (C) 2003-"$(hg_year $1)" * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). *