0
3
0
1 | 1 |
#! /usr/bin/env python |
2 |
# |
|
3 |
# This file is a part of LEMON, a generic C++ optimization library. |
|
4 |
# |
|
5 |
# Copyright (C) 2003-2009 |
|
6 |
# Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
|
7 |
# (Egervary Research Group on Combinatorial Optimization, EGRES). |
|
8 |
# |
|
9 |
# Permission to use, modify and distribute this software is granted |
|
10 |
# provided that this copyright notice appears in all copies. For |
|
11 |
# precise terms see the accompanying LICENSE file. |
|
12 |
# |
|
13 |
# This software is provided "AS IS" with no warranty of any kind, |
|
14 |
# express or implied, and with no claim as to its suitability for any |
|
15 |
# purpose. |
|
2 | 16 |
|
3 | 17 |
import sys |
4 | 18 |
|
5 | 19 |
from mercurial import ui, hg |
6 | 20 |
from mercurial import util |
7 | 21 |
|
8 | 22 |
util.rcpath = lambda : [] |
9 | 23 |
|
10 | 24 |
if len(sys.argv)>1 and sys.argv[1] in ["-h","--help"]: |
11 | 25 |
print """ |
12 | 26 |
This utility just prints the length of the longest path |
13 | 27 |
in the revision graph from revison 0 to the current one. |
14 | 28 |
""" |
15 | 29 |
exit(0) |
16 | 30 |
|
17 | 31 |
u = ui.ui() |
18 | 32 |
r = hg.repository(u, ".") |
19 | 33 |
N = r.changectx(".").rev() |
20 | 34 |
lengths=[0]*(N+1) |
21 | 35 |
for i in range(N+1): |
22 | 36 |
p=r.changectx(i).parents() |
23 | 37 |
if p[0]: |
24 | 38 |
p0=lengths[p[0].rev()] |
25 | 39 |
else: |
26 | 40 |
p0=-1 |
27 | 41 |
if len(p)>1 and p[1]: |
28 | 42 |
p1=lengths[p[1].rev()] |
29 | 43 |
else: |
30 | 44 |
p1=-1 |
31 | 45 |
lengths[i]=max(p0,p1)+1 |
32 | 46 |
print lengths[N] |
1 | 1 |
#!/bin/bash |
2 |
# |
|
3 |
# This file is a part of LEMON, a generic C++ optimization library. |
|
4 |
# |
|
5 |
# Copyright (C) 2003-2009 |
|
6 |
# Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
|
7 |
# (Egervary Research Group on Combinatorial Optimization, EGRES). |
|
8 |
# |
|
9 |
# Permission to use, modify and distribute this software is granted |
|
10 |
# provided that this copyright notice appears in all copies. For |
|
11 |
# precise terms see the accompanying LICENSE file. |
|
12 |
# |
|
13 |
# This software is provided "AS IS" with no warranty of any kind, |
|
14 |
# express or implied, and with no claim as to its suitability for any |
|
15 |
# purpose. |
|
2 | 16 |
|
3 | 17 |
set -e |
4 | 18 |
|
5 | 19 |
if [ $# = 0 ]; then |
6 | 20 |
echo "Usage: $0 release-id" |
7 | 21 |
exit 1 |
8 | 22 |
else |
9 | 23 |
export LEMON_VERSION=$1 |
10 | 24 |
fi |
11 | 25 |
|
12 | 26 |
echo '*****************************************************************' |
13 | 27 |
echo ' Start making release tarballs for version '${LEMON_VERSION} |
14 | 28 |
echo '*****************************************************************' |
15 | 29 |
|
16 | 30 |
autoreconf -vif |
17 | 31 |
./configure |
18 | 32 |
|
19 | 33 |
make |
20 | 34 |
make html |
21 | 35 |
make distcheck |
22 | 36 |
tar xf lemon-${LEMON_VERSION}.tar.gz |
23 | 37 |
zip -r lemon-${LEMON_VERSION}.zip lemon-${LEMON_VERSION} |
24 | 38 |
mv lemon-${LEMON_VERSION}/doc/html lemon-doc-${LEMON_VERSION} |
25 | 39 |
tar czf lemon-doc-${LEMON_VERSION}.tar.gz lemon-doc-${LEMON_VERSION} |
26 | 40 |
zip -r lemon-doc-${LEMON_VERSION}.zip lemon-doc-${LEMON_VERSION} |
27 | 41 |
tar czf lemon-nodoc-${LEMON_VERSION}.tar.gz lemon-${LEMON_VERSION} |
28 | 42 |
zip -r lemon-nodoc-${LEMON_VERSION}.zip lemon-${LEMON_VERSION} |
29 | 43 |
hg tag -m 'LEMON '${LEMON_VERSION}' released ('$(hg par --template="{node|short}")' tagged as r'${LEMON_VERSION}')' r${LEMON_VERSION} |
30 | 44 |
|
31 | 45 |
rm -rf lemon-${LEMON_VERSION} lemon-doc-${LEMON_VERSION} |
32 | 46 |
|
33 | 47 |
echo '*****************************************************************' |
34 | 48 |
echo ' Release '${LEMON_VERSION}' has been created' |
35 | 49 |
echo '*****************************************************************' |
1 | 1 |
#!/bin/bash |
2 |
# |
|
3 |
# This file is a part of LEMON, a generic C++ optimization library. |
|
4 |
# |
|
5 |
# Copyright (C) 2003-2009 |
|
6 |
# Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
|
7 |
# (Egervary Research Group on Combinatorial Optimization, EGRES). |
|
8 |
# |
|
9 |
# Permission to use, modify and distribute this software is granted |
|
10 |
# provided that this copyright notice appears in all copies. For |
|
11 |
# precise terms see the accompanying LICENSE file. |
|
12 |
# |
|
13 |
# This software is provided "AS IS" with no warranty of any kind, |
|
14 |
# express or implied, and with no claim as to its suitability for any |
|
15 |
# purpose. |
|
2 | 16 |
|
3 | 17 |
YEAR=`date +%Y` |
4 | 18 |
HGROOT=`hg root` |
5 | 19 |
|
6 | 20 |
function hg_year() { |
7 | 21 |
if [ -n "$(hg st $1)" ]; then |
8 | 22 |
echo $YEAR |
9 | 23 |
else |
10 | 24 |
hg log -l 1 --template='{date|isodate}\n' $1 | |
11 | 25 |
cut -d '-' -f 1 |
12 | 26 |
fi |
13 | 27 |
} |
14 | 28 |
|
15 | 29 |
# file enumaration modes |
16 | 30 |
|
17 | 31 |
function all_files() { |
18 | 32 |
hg status -a -m -c | |
19 | 33 |
cut -d ' ' -f 2 | grep -E '(\.(cc|h|dox)$|Makefile\.am$)' | |
20 | 34 |
while read file; do echo $HGROOT/$file; done |
21 | 35 |
} |
22 | 36 |
|
23 | 37 |
function modified_files() { |
24 | 38 |
hg status -a -m | |
25 | 39 |
cut -d ' ' -f 2 | grep -E '(\.(cc|h|dox)$|Makefile\.am$)' | |
26 | 40 |
while read file; do echo $HGROOT/$file; done |
27 | 41 |
} |
28 | 42 |
|
29 | 43 |
function changed_files() { |
30 | 44 |
{ |
31 | 45 |
if [ -n "$HG_PARENT1" ] |
32 | 46 |
then |
33 | 47 |
hg status --rev $HG_PARENT1:$HG_NODE -a -m |
34 | 48 |
fi |
35 | 49 |
if [ -n "$HG_PARENT2" ] |
36 | 50 |
then |
37 | 51 |
hg status --rev $HG_PARENT2:$HG_NODE -a -m |
38 | 52 |
fi |
39 | 53 |
} | cut -d ' ' -f 2 | grep -E '(\.(cc|h|dox)$|Makefile\.am$)' | |
40 | 54 |
sort | uniq | |
41 | 55 |
while read file; do echo $HGROOT/$file; done |
42 | 56 |
} |
43 | 57 |
|
44 | 58 |
function given_files() { |
45 | 59 |
for file in $GIVEN_FILES |
46 | 60 |
do |
47 | 61 |
echo $file |
48 | 62 |
done |
49 | 63 |
} |
0 comments (0 inline)