Changeset 784 for branches/replacing_gnuplot
- Timestamp:
- Apr 9, 2009, 10:18:54 PM (14 years ago)
- Location:
- branches/replacing_gnuplot
- Files:
-
- 3 deleted
- 94 edited
- 26 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/replacing_gnuplot
- Property svn:ignore
-
old new 8 8 autom4te.cache 9 9 INSTALL 10 COPYING11 10 aclocal.m4 12 11 Makefile
-
- Property svn:ignore
-
branches/replacing_gnuplot/.svndigest/config
r521 r784 3 3 ### The commented-out below are intended to demonstrate how to use 4 4 ### this file. 5 6 ### Section for setting behaviour of copyright update 7 [copyright] 8 # if true svndigest will warn if file has no copyright statement. 9 missing-copyright-warning = no 5 10 6 11 ### Section for setting aliases used in copyright update … … 13 18 [trac] 14 19 # If trac-root is set, svndigest will create anchors to the Trac page. 15 # trac-root = http:// trac.thep.lu.se/svndigest/16 trac-root = http:// trac.thep.lu.se/svndigest/20 # trac-root = http://dev.thep.lu.se/svndigest/ 21 trac-root = http://dev.thep.lu.se/svndigest/ 17 22 18 23 ### Section for setting dictionary for file names. 19 ### Prior looking for file name pattern in section [ codon],24 ### Prior looking for file name pattern in section [parsing-codons], 20 25 ### the file name may be translated according to the rules 21 26 ### in this section. In default setting there is, for example, … … 37 42 [parsing-codons] 38 43 *.ac = "#":"\n" ; "dnl":"\n" 39 *.am = "#":"\n" ; "dnl":"\n"44 *.am = "#":"\n" 40 45 *.m4 = "#":"\n" ; "dnl":"\n" 41 46 *.c = "//":"\n" ; "/*":"*/" -
branches/replacing_gnuplot/AUTHORS
r646 r784 2 2 3 3 Copyright (C) 2005, 2006, 2008 Jari Häkkinen 4 Copyright (C) 2007, 2008 Peter Johansson 4 5 5 6 Files are copyright by their respective authors. The contributions to … … 7 8 source code revision system. 8 9 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 11 12 svndigest is free software; you can redistribute it and/or modify it 12 13 under the terms of the GNU General Public License as published by the 13 Free Software Foundation; either version 2of the License, or (at your14 Free Software Foundation; either version 3 of the License, or (at your 14 15 option) any later version. 15 16 … … 20 21 21 22 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 24 USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 26 25 -
branches/replacing_gnuplot/ChangeLog
r588 r784 4 4 Copyright (C) 2005, 2006 Jari Häkkinen 5 5 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 6 Copyright (C) 2008 Peter Johansson6 Copyright (C) 2008, 2009 Peter Johansson 7 7 8 This file is part of svndigest, http:// trac.thep.lu.se/svndigest8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 9 9 10 10 svndigest is free software; you can redistribute it and/or modify it 11 11 under the terms of the GNU General Public License as published by the 12 Free Software Foundation; either version 2of the License, or (at your12 Free Software Foundation; either version 3 of the License, or (at your 13 13 option) any later version. 14 14 … … 19 19 20 20 You should have received a copy of the GNU General Public License 21 along with this program; if not, write to the Free Software 22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 23 USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 24 22 }}} 25 23 ---------------------------------------------------------------------- … … 29 27 30 28 version 0.7: 31 - http://trac.thep.lu.se/svndigest/log/trunk?rev=HEAD&stop_rev=418 32 - http://trac.thep.lu.se/svndigest/query?milestone=0.7&order=id 29 - http://dev.thep.lu.se/svndigest/log/trunk?rev=HEAD&stop_rev=418 30 - http://dev.thep.lu.se/svndigest/query?milestone=0.7&order=id 31 32 version 0.6.7: 33 - http://dev.thep.lu.se/svndigest/log/branches/0.6-stable?rev=765&stop_rev=687 34 - http://dev.thep.lu.se/svndigest/query?milestone=svndigest+0.6.7&order=id 35 36 version 0.6.6: 37 - http://dev.thep.lu.se/svndigest/log/branches/0.6-stable?rev=685&stop_rev=577 38 - http://dev.thep.lu.se/svndigest/query?milestone=svndigest+0.6.6&order=id 33 39 34 40 version 0.6.5: 35 - http:// trac.thep.lu.se/svndigest/log/branches/0.6-stable?rev=575&stop_rev=49136 - http:// trac.thep.lu.se/svndigest/query?milestone=0.6.5&order=id41 - http://dev.thep.lu.se/svndigest/log/branches/0.6-stable?rev=575&stop_rev=491 42 - http://dev.thep.lu.se/svndigest/query?milestone=svndigest+0.6.5&order=id 37 43 38 44 version 0.6.4: 39 - http:// trac.thep.lu.se/svndigest/log/branches/0.6-stable?rev=489&stop_rev=47440 - http:// trac.thep.lu.se/svndigest/query?milestone=0.6.4&order=id45 - http://dev.thep.lu.se/svndigest/log/branches/0.6-stable?rev=489&stop_rev=474 46 - http://dev.thep.lu.se/svndigest/query?milestone=0.6.4&order=id 41 47 42 48 version 0.6.3: 43 - http:// trac.thep.lu.se/svndigest/log/branches/0.6-stable?rev=472&stop_rev=46044 - http:// trac.thep.lu.se/svndigest/query?milestone=0.6.3&order=id49 - http://dev.thep.lu.se/svndigest/log/branches/0.6-stable?rev=472&stop_rev=460 50 - http://dev.thep.lu.se/svndigest/query?milestone=0.6.3&order=id 45 51 46 52 version 0.6.2: 47 - http:// trac.thep.lu.se/svndigest/log/branches/0.6-stable?rev=459&stop_rev=43848 - http:// trac.thep.lu.se/svndigest/query?milestone=0.6.2&order=id53 - http://dev.thep.lu.se/svndigest/log/branches/0.6-stable?rev=459&stop_rev=438 54 - http://dev.thep.lu.se/svndigest/query?milestone=0.6.2&order=id 49 55 50 56 version 0.6.1: 51 - http:// trac.thep.lu.se/svndigest/log/branches/0.6-stable?rev=437&stop_rev=41752 - http:// trac.thep.lu.se/svndigest/query?milestone=0.6.1&order=id57 - http://dev.thep.lu.se/svndigest/log/branches/0.6-stable?rev=437&stop_rev=417 58 - http://dev.thep.lu.se/svndigest/query?milestone=0.6.1&order=id 53 59 54 60 version 0.6: 55 - http:// trac.thep.lu.se/svndigest/log/trunk?rev=413&stop_rev=19556 - http:// trac.thep.lu.se/svndigest/query?milestone=0.6&order=id61 - http://dev.thep.lu.se/svndigest/log/trunk?rev=413&stop_rev=195 62 - http://dev.thep.lu.se/svndigest/query?milestone=0.6&order=id 57 63 58 64 version 0.5: 59 - http:// trac.thep.lu.se/svndigest/log/trunk?rev=194&stop_rev=15160 - http:// trac.thep.lu.se/svndigest/query?milestone=0.5&order=id65 - http://dev.thep.lu.se/svndigest/log/trunk?rev=194&stop_rev=151 66 - http://dev.thep.lu.se/svndigest/query?milestone=0.5&order=id 61 67 62 68 version 0.4: 63 - http:// trac.thep.lu.se/svndigest/log/trunk?rev=150&stop_rev=14869 - http://dev.thep.lu.se/svndigest/log/trunk?rev=150&stop_rev=148 64 70 65 71 version 0.3: 66 - http:// trac.thep.lu.se/svndigest/log/trunk?rev=147&stop_rev=8367 - http:// trac.thep.lu.se/svndigest/query?milestone=0.3&order=id72 - http://dev.thep.lu.se/svndigest/log/trunk?rev=147&stop_rev=83 73 - http://dev.thep.lu.se/svndigest/query?milestone=0.3&order=id 68 74 69 75 version 0.1 and 0.2: 70 - http:// trac.thep.lu.se/svndigest/log/trunk?rev=82&stop_rev=171 - http:// trac.thep.lu.se/svndigest/query?milestone=0.2&order=id72 - http:// trac.thep.lu.se/svndigest/query?milestone=0.1&order=id76 - http://dev.thep.lu.se/svndigest/log/trunk?rev=82&stop_rev=1 77 - http://dev.thep.lu.se/svndigest/query?milestone=0.2&order=id 78 - http://dev.thep.lu.se/svndigest/query?milestone=0.1&order=id -
branches/replacing_gnuplot/Makefile.am
r569 r784 4 4 5 5 # Copyright (C) 2005, 2006 Jari Häkkinen 6 # Copyright (C) 2007 2008 Peter Johansson6 # Copyright (C) 2007, 2008 Peter Johansson 7 7 # 8 # This file is part of svndigest, http:// trac.thep.lu.se/svndigest8 # This file is part of svndigest, http://dev.thep.lu.se/svndigest 9 9 # 10 10 # svndigest is free software; you can redistribute it and/or modify it 11 11 # under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2of the License, or12 # the Free Software Foundation; either version 3 of the License, or 13 13 # (at your option) any later version. 14 14 # … … 19 19 # 20 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 23 # 02111-1307, USA. 21 # along with svndigest. If not, see <http://www.gnu.org/licenses/>. 24 22 25 SUBDIRS = lib bin test 23 # -I arg should be the same as arg in AC_CONFIG_MACRO_DIR in configure.ac 24 ACLOCAL_AMFLAGS = -I m4 --install 25 26 SUBDIRS = lib bin man test 26 27 27 28 EXTRA_dist = build_support/move-if-change … … 29 30 clean-local: 30 31 rm -rf svndigest *~ 32 33 if ENABLE_SVN_SUPPORT 34 include build_support/svn_support.am 35 endif 36 37 38 # This is a workaround to avoid a broken make when .m4 files are 39 # renamed or deleted. Something similar will be provided by Automake 1.11 40 $(am__aclocal_m4_deps): -
branches/replacing_gnuplot/NEWS
r580 r784 4 4 5 5 Version 0.7 (released DATE) 6 - Upgraded to GLPv3 (ticket:339) 7 - configure option --enable-staticbin is removed (ticket:340) 6 8 - configure option --enable-wctests is removed (ticket:295) 7 9 - parsing rules can be set in config file (ticket:283) 8 10 9 11 A complete list of closed tickets can be found here [[br]] 10 http://trac.thep.lu.se/svndigest/query?status=closed&milestone=0.7 12 http://dev.thep.lu.se/svndigest/query?status=closed&milestone=0.7 13 14 version 0.6.7 (released 1 February 2009) 15 - Improved TracLinks (issue #353) 16 - Daylight saving time is now handled correctly (issue #353) 17 18 A complete list of closed tickets can be found here [[br]] 19 http://dev.thep.lu.se/svndigest/query?status=closed&milestone=svndigest+0.6.7 20 21 version 0.6.6 (released 4 August 2008) 22 - Improved removal of sub-directory in --target dir (ticket:242 ticket:243) 23 - References were changed to http://dev.thep.lu.se/svndigest 24 25 A complete list of closed tickets can be found here [[br]] 26 http://dev.thep.lu.se/svndigest/query?status=closed&milestone=svndigest+0.6.6 11 27 12 28 version 0.6.5 (released 18 March 2008) … … 15 31 16 32 A complete list of closed tickets can be found here [[br]] 17 http:// trac.thep.lu.se/trac/svndigest/query?status=closed&milestone=0.6.533 http://dev.thep.lu.se/svndigest/query?status=closed&milestone=svndigest+0.6.5 18 34 19 35 version 0.6.4 (released 14 October 2007) … … 22 38 23 39 A complete list of closed tickets can be found here [[br]] 24 http:// trac.thep.lu.se/svndigest/query?status=closed&milestone=0.6.440 http://dev.thep.lu.se/svndigest/query?status=closed&milestone=0.6.4 25 41 26 42 version 0.6.3 (released 31 August 2007) … … 29 45 30 46 A complete list of closed tickets can be found here [[br]] 31 http:// trac.thep.lu.se/svndigest/query?status=closed&milestone=0.6.347 http://dev.thep.lu.se/svndigest/query?status=closed&milestone=0.6.3 32 48 33 49 Version 0.6.2 (released 21 August 2007) … … 35 51 36 52 A complete list of closed tickets can be found here [[br]] 37 http:// trac.thep.lu.se/svndigest/query?status=closed&milestone=0.6.253 http://dev.thep.lu.se/svndigest/query?status=closed&milestone=0.6.2 38 54 39 55 Version 0.6.1 (released 9 July 2007) 40 - changed refs to svndigest site to http:// trac.thep.lu.se/svndigest56 - changed refs to svndigest site to http://dev.thep.lu.se/svndigest 41 57 - fixed lineover bug in blame output (ticket:235) 42 58 43 59 A complete list of closed tickets can be found here [[br]] 44 http:// trac.thep.lu.se/svndigest/query?status=closed&milestone=0.6.160 http://dev.thep.lu.se/svndigest/query?status=closed&milestone=0.6.1 45 61 46 62 Version 0.6 (released 29 June 2007) … … 55 71 56 72 A complete list of closed tickets can be found here [[br]] 57 http:// trac.thep.lu.se/svndigest/query?status=closed&milestone=0.673 http://dev.thep.lu.se/svndigest/query?status=closed&milestone=0.6 58 74 59 75 Version 0.5 (released 7 September 2006) … … 86 102 Copyright (C) 2005, 2006 Jari Häkkinen 87 103 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 88 Copyright (C) 2008 Peter Johansson104 Copyright (C) 2008, 2009 Peter Johansson 89 105 90 This file is part of svndigest, http:// trac.thep.lu.se/svndigest106 This file is part of svndigest, http://dev.thep.lu.se/svndigest 91 107 92 108 svndigest is free software; you can redistribute it and/or modify it 93 109 under the terms of the GNU General Public License as published by the 94 Free Software Foundation; either version 2of the License, or (at your110 Free Software Foundation; either version 3 of the License, or (at your 95 111 option) any later version. 96 112 … … 101 117 102 118 You should have received a copy of the GNU General Public License 103 along with this program; if not, write to the Free Software 104 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 119 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 105 120 USA. 106 121 }}} -
branches/replacing_gnuplot/README
r646 r784 27 27 svndigest can be obtained from 28 28 29 http:// trac.thep.lu.se/svndigest/wiki/DownloadPage29 http://dev.thep.lu.se/svndigest/wiki/DownloadPage 30 30 31 31 … … 75 75 svndigest. You can provide `./configure` with APR and subversion API 76 76 location information with `--with-apr=DIR` and `--with-svn=DIR`, 77 respectively. `--enable-staticbin` will create a static 78 svndigest binary. (Actually as static as the underlying program 79 libraries allows it to be, i.e., some external libraries might not 80 have been created/installed in static versions.) 77 respectively. 81 78 82 79 If you grabbed the source from the subversion repository you need to … … 88 85 The development of svndigest can be monitored through 89 86 90 http:// trac.thep.lu.se/svndigest87 http://dev.thep.lu.se/svndigest 91 88 92 89 You can find most information concerning the development of svndigest at … … 98 95 You can report svndigest bugs on 99 96 100 http:// trac.thep.lu.se/svndigest/newticket97 http://dev.thep.lu.se/svndigest/newticket 101 98 102 99 Use user `svndigest` and password `svndigest`. … … 108 105 access, issue: 109 106 110 `svn checkout http:// lev.thep.lu.se/repository/svndigest/trunk svndigest`107 `svn checkout http://dev.thep.lu.se/svndigest/svn/trunk svndigest` 111 108 112 109 See file README.developer for developer specific information. We make no … … 119 116 {{{ 120 117 Copyright (C) 2005, 2006 Jari Häkkinen 121 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 122 Copyright (C) 2008 Jari Häkkinen 118 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 123 119 124 This file is part of svndigest, http:// trac.thep.lu.se/svndigest120 This file is part of svndigest, http://dev.thep.lu.se/svndigest 125 121 126 122 svndigest is free software; you can redistribute it and/or modify it 127 123 under the terms of the GNU General Public License as published by the 128 Free Software Foundation; either version 2of the License, or (at your124 Free Software Foundation; either version 3 of the License, or (at your 129 125 option) any later version. 130 126 … … 135 131 136 132 You should have received a copy of the GNU General Public License 137 along with this program; if not, write to the Free Software 138 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 139 USA. 133 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 140 134 }}} 141 142 -
branches/replacing_gnuplot/README.developer
r583 r784 20 20 We follow these guidelines. 21 21 22 23 === Requirements === 24 25 To build from a subversion checkout, you will need Autotools. More 26 specifically Automake 1.10 (or later) and Autoconf 2.61 (or later). To 27 build man page you will need help2man. 22 28 23 29 === bootstrap and autoreconf === … … 121 127 == Releasing == 122 128 123 See http:// trac.thep.lu.se/svndigest/wiki/ReleaseProcedure129 See http://dev.thep.lu.se/svndigest/wiki/ReleaseProcedure 124 130 125 131 … … 130 136 Copyright (C) 2008 Peter Johansson 131 137 132 This file is part of svndigest, http:// trac.thep.lu.se/svndigest138 This file is part of svndigest, http://dev.thep.lu.se/svndigest 133 139 134 140 svndigest is free software; you can redistribute it and/or modify it 135 141 under the terms of the GNU General Public License as published by the 136 Free Software Foundation; either version 2of the License, or (at your142 Free Software Foundation; either version 3 of the License, or (at your 137 143 option) any later version. 138 144 … … 143 149 144 150 You should have received a copy of the GNU General Public License 145 along with this program; if not, write to the Free Software 146 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 147 USA. 148 151 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 149 152 }}} -
branches/replacing_gnuplot/THANKS
r569 r784 18 18 the generated CSS file, svndigest.css. 19 19 20 During the build process svndigest automagically incorporate its20 During the build process svndigest automagically incorporates its 21 21 current svn revision into the source and binary. The solution, based 22 on a suggest ed byMarkus Hoenicka, works both when being in a22 on a suggestion from Markus Hoenicka, works both when being in a 23 23 subversion WC (using svnversion) and when being outside. Hoenicka's 24 24 suggestion can be found here: … … 35 35 Copyright (C) 2008 Peter Johansson 36 36 37 This file is part of svndigest, http:// trac.thep.lu.se/svndigest37 This file is part of svndigest, http://dev.thep.lu.se/svndigest 38 38 39 39 svndigest is free software; you can redistribute it and/or modify it 40 40 under the terms of the GNU General Public License as published by the 41 Free Software Foundation; either version 2of the License, or (at your41 Free Software Foundation; either version 3 of the License, or (at your 42 42 option) any later version. 43 43 … … 48 48 49 49 You should have received a copy of the GNU General Public License 50 along with this program; if not, write to the Free Software 51 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 52 USA. 53 50 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 54 51 }}} 55 -
branches/replacing_gnuplot/bin/Makefile.am
r646 r784 6 6 # Copyright (C) 2006 Jari Häkkinen, Peter Johansson 7 7 # Copyright (C) 2007, 2008 Peter Johansson 8 # Copyright (C) 2008 Jari Häkkinen, Peter Johansson 8 9 # 9 # This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 # This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 # 11 12 # svndigest is free software; you can redistribute it and/or modify it 12 13 # under the terms of the GNU General Public License as published by 13 # the Free Software Foundation; either version 2of the License, or14 # the Free Software Foundation; either version 3 of the License, or 14 15 # (at your option) any later version. 15 16 # … … 20 21 # 21 22 # You should have received a copy of the GNU General Public License 22 # along with this program; if not, write to the Free Software 23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 # 02111-1307, USA. 23 # along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 26 25 bin_PROGRAMS = svndigest … … 30 29 noinst_HEADERS = Parameter.h 31 30 32 LDADD = @top_builddir@/lib/libsvndigest.la $(SVNDIGEST_LIBS)33 AM_LDFLAGS = $(S TATICFLAG) $(SVNDIGEST_LDFLAGS)31 LDADD = $(top_builddir)/lib/libsvndigest.a $(SVNDIGEST_LIBS) 32 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) 34 33 35 AM_CPPFLAGS = -I @top_srcdir@/lib $(SVNDIGEST_CPPFLAGS)34 AM_CPPFLAGS = -I$(top_srcdir)/lib $(SVNDIGEST_CPPFLAGS) 36 35 AM_CXXFLAGS = $(SVNDIGEST_CXXFLAGS) 37 36 38 37 39 # install versioned binary (excluding patch version)40 install-exec-hook:41 cd $(DESTDIR)$(bindir) && \42 mv -f svndigest$(EXEEXT) \43 svndigest-$(MAJOR_VERSION).$(MINOR_VERSION)$(EXEEXT) && \44 $(LN_S) svndigest-$(MAJOR_VERSION).$(MINOR_VERSION)$(EXEEXT) svndigest$(EXEEXT)45 46 uninstall-hook:47 cd $(DESTDIR)$(bindir) && \48 rm -f svndigest-$(MAJOR_VERSION).$(MINOR_VERSION)$(EXEEXT)49 50 38 clean-local: 51 39 rm -rf *~ -
branches/replacing_gnuplot/bin/Parameter.cc
r646 r784 2 2 3 3 /* 4 Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2008 Peter Johansson 6 7 This file is part of svndigest, http://trac.thep.lu.se/svndigest 4 Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 5 6 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 7 9 8 svndigest is free software; you can redistribute it and/or modify it 10 9 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or10 the Free Software Foundation; either version 3 of the License, or 12 11 (at your option) any later version. 13 12 … … 18 17 19 18 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 19 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 20 */ 24 21 … … 26 23 27 24 #include "ColumnStream.h" 28 #include "subversion_info.h" 25 #include "OptionArg.h" 26 #include "OptionHelp.h" 27 #include "OptionSwitch.h" 28 #include "OptionVersion.h" 29 29 #include "utility.h" 30 30 #include <config.h> // this header file is created by configure 31 31 32 #include <cassert> 33 #include <cerrno> 32 34 #include <cstddef> 35 #include <cstring> 33 36 #include <fstream> 34 37 #include <iostream> … … 42 45 43 46 Parameter::Parameter( int argc, char *argv[]) 44 : config_file_(""), copyright_(false), force_(false), 45 generate_config_(false), ignore_cache_(false), report_(true), 46 revisions_(false), root_("."), root_node_("."), targetdir_("."), 47 verbose_(false) 48 { 49 for (int i=1; i<argc; ++i) { 50 std::stringstream ss(argv[i]); 51 std::string myargv(""); 52 std::string value(""); 53 getline(ss, myargv, '='); 54 getline(ss, value); 55 56 if (myargv=="--config-file"){ 57 if (value.size()) { 58 config_file_.value()= value; 47 : cmd_( 48 "Mandatory arguments to long options are mandatory for short options too.") 49 { 50 init(); 51 try { 52 cmd_.parse(argc, argv); 53 } 54 catch (cmd_error& e) { 55 std::cerr << e.what() << std::endl; 56 exit (-1); 57 } 58 59 // set default values 60 if (!root_->present()) 61 root_->value("."); 62 63 if (!target_->present()) 64 target_->value("."); 65 66 if (!config_file_->present()) 67 config_file_->value(concatenate_path(root_->value(),".svndigest/config")); 68 69 // analyse arguments 70 analyse(); 71 } 72 73 74 Parameter::~Parameter(void) 75 { 76 delete config_file_; 77 delete copyright_; 78 delete force_; 79 delete generate_config_; 80 delete help_; 81 delete ignore_cache_; 82 delete report_; 83 delete revisions_; 84 delete root_; 85 delete target_; 86 delete verbose_; 87 delete version_; 88 } 89 90 91 void Parameter::analyse(void) 92 { 93 std::string save_wd = pwd(); 94 95 // check root but not if -g option given 96 if (!generate_config()) { 97 check_existence(root_->value()); 98 check_readable(root_->value()); 99 if (chdir(root_->value().c_str())) { 100 std::stringstream ss; 101 ss << "svndigest: cannot read `" << root_->value() << "': " 102 << strerror(errno); 103 throw cmd_error(ss.str()); 104 } 105 root_->value(pwd()); 106 chdir(save_wd.c_str()); 107 108 // check target (only if we write report) 109 if (report()) { 110 check_existence(target_->value()); 111 check_readable(target_->value()); 112 std::string base_root = file_name(root_->value()); 113 std::string path = concatenate_path(target_->value(),base_root); 114 if (access_rights(target_->value().c_str(), "w")) { 115 std::stringstream ss; 116 ss << "svndigest: cannot create directory `" << path 117 << "': " << strerror(errno); 118 throw cmd_error(ss.str()); 59 119 } 60 else if (++i<argc){ 61 config_file_.value()= std::string(argv[i]); 120 if (node_exist(path) && !force()) { 121 std::stringstream ss; 122 ss << "svndigest: cannot create directory `" << path << "' " 123 << strerror(EEXIST); 124 throw cmd_error(ss.str()); 62 125 } 63 else { 64 missing_argument(myargv); 126 if (chdir(target_->value().c_str())) { 127 std::stringstream ss; 128 ss << "svndigest: cannot read `" << target_->value() << "': " 129 << strerror(errno); 130 throw cmd_error(ss.str()); 65 131 } 132 target_->value(pwd()); 133 chdir(save_wd.c_str()); 66 134 } 67 else if (myargv=="--copyright"){ 68 copyright_.value()=true; 135 } 136 137 // check config file 138 struct stat nodestat; 139 // true also if there is a broken symlink named... 140 bool config_exists = !lstat(config_file_->value().c_str(), &nodestat); 141 // the latter case in order to catch broken symlink 142 if (config_file_->present() || config_exists) 143 // throws if file does not exists 144 check_existence(config_file_->value()); 145 if (config_exists) { 146 // throws if file is not readable 147 check_readable(config_file_->value()); 148 stat(config_file_->value().c_str(), &nodestat); 149 if (!S_ISREG(nodestat.st_mode)) { 150 std::stringstream ss; 151 ss << "svndigest: `" << config_file_->value() 152 << "' is not a regular file"; 153 throw cmd_error(ss.str()); 69 154 } 70 else if (myargv=="-f" || myargv=="--force"){ 71 force_.value()=true; 72 } 73 else if (myargv=="-g" || myargv=="--generate-config"){ 74 generate_config_.value()=true; 75 } 76 else if (myargv=="-h" || myargv=="--help"){ 77 help(); 78 exit(0); // always exit after printing help 79 } 80 else if (myargv=="--ignore-cache"){ 81 ignore_cache_.value()=true; 82 } 83 else if (myargv=="-r" || myargv=="--root"){ 84 if (value.size()) { 85 root_.value()= value; 86 } 87 else if (++i<argc){ 88 root_.value()= std::string(argv[i]); 89 } 90 else { 91 missing_argument(myargv); 92 } 93 } 94 else if (myargv=="--report") { 95 report_.value()=true; 96 } 97 else if (myargv=="--no-report") { 98 report_.value()=false; 99 } 100 else if (myargv=="--revisions") { 101 revisions_.value()=true; 102 } 103 else if (myargv=="-t" || myargv=="--target"){ 104 if (value.size()) { 105 targetdir_.value()= value; 106 } 107 else if (++i<argc){ 108 targetdir_.value()= std::string(argv[i]); 109 } 110 else { 111 missing_argument(myargv); 112 } 113 } 114 else if (myargv=="-v" || myargv=="--verbose"){ 115 verbose_.value()=true; 116 } 117 else if (myargv=="--version"){ 118 version(); 119 exit(0); 120 } 121 else if (myargv=="-vf" || myargv=="-fv"){ 122 verbose_.value()=true; 123 force_.value()=true; 124 } 125 else { 126 throw std::runtime_error("svndigest: invalid option: " + myargv + 127 "\nTry `svndigest --help' for usage."); 128 } 129 } 130 131 analyse(); 132 } 133 134 135 void Parameter::analyse(void) 136 { 137 using namespace std; 138 139 string workdir(pwd()); // remember current working directory (cwd). 140 141 if (!node_exist(root_.value())) 142 throw runtime_error(string("svndigest: cannot stat `" + root_.value() + 143 "': no such file or directory")); 144 145 if (access_rights(root_.value(), "r")) 146 throw runtime_error(string("svndigest: cannot open `" + root_.value() + 147 "' for reading: Permission denied")); 148 149 // Check whether root is directory or file 150 struct stat nodestat; 151 stat(root_.value().c_str(), &nodestat); 152 if (S_ISDIR(nodestat.st_mode)) { 153 chdir(root_.value().c_str()); 154 root_node_.value() = root_.value() = pwd(); 155 } 156 else { 157 std::string fname = file_name(root_.value()); 158 root_.value() = directory_name(root_.value()); 159 chdir(root_.value().c_str()); 160 root_.value() = pwd(); 161 root_node_.value() = root_.value() + "/" + fname; 162 } 163 164 // need to get back to cwd if relative paths are used. 165 if (chdir(workdir.c_str())) 166 runtime_error(string("svndigest: Failed to access cwd: ") + workdir); 167 168 // Checking that targetdir_ exists and retrieve the absolute path 169 // to targetdir_ 170 if (report()) { 171 if (chdir(targetdir_.value().c_str())) 172 throw runtime_error(string("svndigest: Target directory (") + 173 targetdir_.value() + ") access failed."); 174 targetdir_.value() = pwd(); 175 // Checking write permissions for targetdir_ 176 if (access_rights(targetdir_.value(),"w")) 177 throw runtime_error(string("svndigest: No write permission on target ") + 178 "directory (" + targetdir_.value() +")."); 179 } 180 181 // return back to cwd 182 if (chdir(workdir.c_str())) 183 throw runtime_error(string("svndigest: Failed to access cwd: ") + workdir); 184 185 } 186 155 } 156 } 157 158 159 void Parameter::check_existence(std::string path) const 160 { 161 if (node_exist(path)) 162 return; 163 std::stringstream ss; 164 ss << "svndigest: cannot stat `" << path << "': " << strerror(errno); 165 throw cmd_error(ss.str()); 166 } 167 168 169 void Parameter::check_readable(std::string path) const 170 { 171 if (!access_rights(path, "r")) 172 return; 173 std::stringstream ss; 174 ss << "svndigest: cannot open `" << path << "': " << strerror(errno); 175 throw cmd_error(ss.str()); 176 } 177 187 178 188 179 std::string Parameter::config_file(void) const 189 180 { 190 // not default 191 if (!config_file_.value().empty()) 192 return config_file_.value(); 181 return config_file_->value(); 182 } 183 184 185 bool Parameter::copyright(void) const 186 { 187 return copyright_->present(); 188 } 189 190 191 bool Parameter::force(void) const 192 { 193 return force_->present(); 194 } 195 196 197 bool Parameter::generate_config(void) const 198 { 199 return generate_config_->present(); 200 } 201 202 203 bool Parameter::ignore_cache(void) const 204 { 205 return ignore_cache_->present(); 206 } 207 208 209 void Parameter::init(void) 210 { 211 // don't use argv[0] because user may rename the binary 212 cmd_.program_name() = PACKAGE_NAME; 213 config_file_=new OptionArg<std::string>(cmd_, "config-file", 214 "configuration file [<ROOT>/.svndigest/config]"); 215 config_file_->print_arg("=FILE"); 216 std::stringstream ss; 217 copyright_ = new OptionSwitch(cmd_, "copyright", 218 "update copyright statement"); 219 220 ss << "if sub-directory named <ROOT> exists in target directory, remove " 221 << "sub-directory before writing results"; 222 force_ = new OptionSwitch(cmd_, "f,force", ss.str()); 223 ss.str(""); 224 225 help_ = new OptionHelp(cmd_); 226 generate_config_ = 227 new OptionSwitch(cmd_, "g,generate-config", 228 "write configuration file to standard output"); 229 230 ss.str(""); 231 ss << "ignore cache files and analyze everything from repository"; 232 ignore_cache_ = new OptionSwitch(cmd_, "ignore-cache", ss.str()); 233 234 report_ = new OptionSwitch(cmd_, "report", "create no HTML report", true); 235 236 ss.str(""); 237 ss << "use revision numbers as time scale instead of dates [dates]"; 238 revisions_ = new OptionSwitch(cmd_, "revisions", ss.str()); 239 240 root_= 241 new OptionArg<std::string>(cmd_, "r,root", 242 "svn controlled directory to perform statistics on [.]"); 243 root_->print_arg("=ROOT"); 244 target_ = new OptionArg<std::string>(cmd_, "t,target", 245 "output directory [.]"); 246 target_->print_arg("=TARGET"); 193 247 194 // default behaviour 195 return root()+"/.svndigest/config"; 196 } 197 198 199 void Parameter::help(void) const 200 { 201 ColumnStream cs(std::cout, 1); 202 cs.width(0)=79; 203 cs.margin(0)=0; 204 ColumnStream cs2(std::cout, 2); 205 // Widest line should fit exactly 206 cs2.width(0)=21; 207 cs2.width(1)=52; 208 cs2.margin(0)=2; 209 // Gnits standard suggest three characters gap between option and description 210 cs2.margin(1)=3; 211 212 std::cout << "Usage: svndigest [OPTION]...\n" 213 << "\n"; 214 215 cs << "Generate statistical report for a subversion repository.\n"; 216 217 cs << "\nMandatory arguments to long options are mandatory for " 218 << "short options too.\n"; 219 220 cs2 << " --config-file=ARG\tconfiguration file " 221 << "[<ROOT>/.svndigest/config]\n" 222 << " --copyright\tupdate copyright statement\n" 223 << "-f, --force\tif sub-directory named <ROOT> exists in " 224 << "target directory, remove sub-directory before writing results\n" 225 << "-g, --generate-config\twrite configuration file " 226 << "to standard output and exit\n" 227 << "-h, --help\tdisplay this help and exit\n" 228 << " --ignore-cache\tignore cache files and analyze " 229 << "everything from repository\n" 230 << " --no-report\tcreate no HTML report\n" 231 << " --revisions\tuse revision numbers as time scale " 232 << "instead of dates [dates]\n" 233 << "-r, --root=ROOT\tsvn controlled directory to perform " 234 << "statistics calculation on [" << root_.default_value() << "]\n" 235 << "-t, --target=TARGET\toutput directory [" 236 << targetdir_.default_value() << "]\n" 237 << "-v, --verbose\texplain what is being done\n" 238 << " --version\tprint version information and exit\n"; 239 240 std::cout << "\nReport bugs to <" << PACKAGE_BUGREPORT << ">." 241 << std::endl; 242 } 243 244 245 void Parameter::missing_argument(std::string opt) const 246 { 247 if (opt.size()>0 && opt[0]=='-') 248 opt = opt.substr(1); 249 if (opt.size()>0 && opt[0]=='-') 250 opt = opt.substr(1); 251 std::stringstream ss; 252 ss << "svndigest: option requires an argument -- " << opt << "\n" 253 << "Try `svndigest --help' for usage."; 254 throw std::runtime_error(ss.str()); 255 } 256 257 void Parameter::version(bool verbose) const 258 { 259 ColumnStream cs(std::cout, 1); 260 cs.width(0)=79; 261 cs << PACKAGE_STRING << version_string() << "\n"; 262 cs << "\nCopyright (C) " << svn_year() 263 << " Jari H\u00E4kkinen and Peter Johansson.\n" 264 << "This is free software. You may redistribute copies of it under " 265 << "the terms of the GNU General Public License " 266 << "<http://www.gnu.org/licenses/gpl.html>.\n" 267 << "There is NO WARRANTY; to the extent permitted by law.\n"; 268 } 248 verbose_ = new OptionSwitch(cmd_, "v,verbose", "explain what is being done"); 249 version_ = new OptionVersion(cmd_, "version", 250 "print version information and exit", verbose_); 251 252 ss.str(""); 253 ss << "Report bugs to " << PACKAGE_BUGREPORT << ".\n"; 254 help_->post_arguments() = ss.str(); 255 help_->synopsis() = 256 "Generate statistical report for a subversion repository\n"; 257 } 258 259 260 bool Parameter::report(void) const 261 { 262 return report_->value(); 263 } 264 265 266 bool Parameter::revisions(void) const 267 { 268 return revisions_->present(); 269 } 270 271 272 std::string Parameter::root(void) const 273 { 274 return root_->value(); 275 } 276 277 278 std::string Parameter::targetdir(void) const 279 { 280 return target_->value(); 281 } 282 283 284 bool Parameter::verbose(void) const 285 { 286 return verbose_->present(); 287 } 288 269 289 270 290 }} // of namespace svndigest and namespace theplu -
branches/replacing_gnuplot/bin/Parameter.h
r646 r784 6 6 /* 7 7 Copyright (C) 2006 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2007 Peter Johansson8 Copyright (C) 2007, 2008 Peter Johansson 9 9 10 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 11 11 12 12 svndigest is free software; you can redistribute it and/or modify it 13 13 under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 15 15 (at your option) any later version. 16 16 … … 21 21 22 22 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 25 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 26 24 */ 27 25 28 #include "Option.h" 26 #include "CommandLine.h" 27 #include "OptionArg.h" 29 28 30 #include <map>31 29 #include <string> 32 30 … … 34 32 namespace svndigest { 35 33 34 class OptionHelp; 35 class OptionSwitch; 36 class OptionVersion; 37 36 38 // class for command line options. 37 39 class Parameter { 38 40 public: 39 41 Parameter( int argc, char *argv[]); 42 virtual ~Parameter(void); 40 43 std::string config_file(void) const; 41 inline bool copyright(void) const { return copyright_.value(); } 42 /// @todo 43 inline bool force(void) const { return force_.value(); } 44 inline bool generate_config(void) const { return generate_config_.value(); } 45 // Until we fix caching (#313) ignore caching 46 //inline bool ignore_cache(void) const { return ignore_cache_.value(); } 47 inline bool ignore_cache(void) const { return true; } 48 inline bool report(void) const { return report_.value(); } 49 inline bool revisions(void) const { return revisions_.value(); } 44 45 bool copyright(void) const; 46 bool force(void) const; 47 bool generate_config(void) const ; 48 bool ignore_cache(void) const; 49 bool report(void) const; 50 bool revisions(void) const; 50 51 /// @return absolute path to root directory 51 inline const std::string& root(void) const { return root_.value(); } 52 /// @return absolute path to root node 53 inline const std::string& root_node(void) const {return root_node_.value();} 52 std::string root(void) const; 54 53 /// @return absolute path to target directory 55 inline const std::string& targetdir(void) const 56 { return targetdir_.value(); } 57 inline bool verbose(void) const { return verbose_.value(); } 54 std::string targetdir(void) const; 55 bool verbose(void) const; 58 56 59 57 private: 60 58 void analyse(void); 61 void help(void) const; 62 void missing_argument(std::string opt) const; 63 void version(bool=false) const; 59 // throw cmd_error if path doesn't exist 60 void check_existence(std::string path) const; 61 // throw cmd_error if path is not dir 62 void check_is_dir(std::string path) const; 63 // throw cmd_error if path is not readable 64 void check_readable(std::string path) const; 64 65 65 Option<std::string> config_file_; 66 Option<bool> copyright_; 67 Option<bool> force_; 68 Option<bool> generate_config_; 69 Option<bool> ignore_cache_; 70 Option<bool> report_; 71 Option<bool> revisions_; 72 Option<std::string> root_; 73 Option<std::string> root_node_; 74 Option<std::string> targetdir_; 75 Option<bool> verbose_; 66 void init(void); 67 68 CommandLine cmd_; 69 OptionArg<std::string>* config_file_; 70 OptionSwitch* copyright_; 71 OptionSwitch* force_; 72 OptionSwitch* generate_config_; 73 OptionHelp* help_; 74 OptionSwitch* ignore_cache_; 75 OptionSwitch* report_; 76 OptionSwitch* revisions_; 77 OptionArg<std::string>* root_; 78 OptionArg<std::string>* target_; 79 OptionSwitch* verbose_; 80 OptionVersion* version_; 81 76 82 }; 77 83 -
branches/replacing_gnuplot/bin/svndigest.cc
r646 r784 3 3 /* 4 4 Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2008 Peter Johansson6 7 This file is part of svndigest, http:// trac.thep.lu.se/svndigest5 Copyright (C) 2008, 2009 Peter Johansson 6 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 8 9 9 svndigest is free software; you can redistribute it and/or modify it 10 10 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 12 12 (at your option) any later version. 13 13 … … 18 18 19 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 21 */ 24 22 … … 28 26 #include "css.h" 29 27 #include "Directory.h" 28 #include "Exception.h" 30 29 #include "first_page.h" 31 30 #include "GnuplotFE.h" … … 61 60 std::cout << "Done parsing parameters" << std::endl; 62 61 } 63 catch ( std::runtime_errore) {62 catch (cmd_error& e) { 64 63 std::cerr << e.what() << std::endl; 65 64 exit(-1); … … 106 105 107 106 // check if target already exists and behave appropriately 108 if (option->verbose()) 109 std::cout << "Checking target directory" << std::endl; 107 bool need_to_erase_target=false; 110 108 std::string target_path=option->targetdir() + '/' + file_name(option->root()); 111 bool need_to_erase_target = node_exist(target_path); 112 if (need_to_erase_target && !option->force()) { 113 std::cerr << "svndigest: directory `" 114 << target_path << "' already exists\n"; 115 exit(-1); 109 if (option->report()) { 110 if (option->verbose()) 111 std::cout << "Checking target directory" << std::endl; 112 need_to_erase_target = node_exist(target_path); 113 if (need_to_erase_target && !option->force()) { 114 std::cerr << "svndigest: directory `" 115 << target_path << "' already exists\n"; 116 exit(-1); 117 } 116 118 } 117 119 … … 164 166 std::vector<std::string> dates; 165 167 dates.reserve(log.commits().size()); 166 for (size_t i=0; i<log.commits().size(); ++i) { 167 assert(static_cast<svn_revnum_t>(i)==log.commits()[i].revision()); 168 dates.push_back(log.commits()[i].date()); 168 for (SVNlog::container::const_iterator iter=log.commits().begin(); 169 iter!=log.commits().end(); ++iter) { 170 assert(static_cast<svn_revnum_t>(dates.size())==iter->revision()); 171 dates.push_back(iter->date()); 169 172 } 170 GnuplotFE::instance()->set_dates(dates); 171 } 172 chdir(option->targetdir().c_str()); 173 GnuplotFE::instance()->set_dates(dates); 174 } 175 if (chdir(option->targetdir().c_str()) ) { 176 std::cerr << "svndigest: chdir " << option->targetdir() << " failed\n"; 177 exit(-1); 178 } 173 179 mkdir(tree->name()); 174 chdir(tree->name().c_str()); 180 if (chdir(tree->name().c_str()) ) { 181 std::cerr << "svndigest: chdir " << tree->name() << " failed\n"; 182 exit(-1); 183 } 175 184 GnuplotFE::instance()->command(std::string("cd '")+option->targetdir()+"/" 176 185 +tree->name()+"'"); -
branches/replacing_gnuplot/bootstrap
r590 r784 8 8 9 9 # Copyright (C) 2005, 2006 Jari Häkkinen 10 # Copyright (C) 2007 Peter Johansson10 # Copyright (C) 2007, 2008 Peter Johansson 11 11 # 12 # This file is part of svndigest, http:// trac.thep.lu.se/svndigest12 # This file is part of svndigest, http://dev.thep.lu.se/svndigest 13 13 # 14 14 # svndigest is free software; you can redistribute it and/or modify it 15 15 # under the terms of the GNU General Public License as published by 16 # the Free Software Foundation; either version 2of the License, or16 # the Free Software Foundation; either version 3 of the License, or 17 17 # (at your option) any later version. 18 18 # … … 23 23 # 24 24 # You should have received a copy of the GNU General Public License 25 # along with this program; if not, write to the Free Software 26 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 27 # 02111-1307, USA. 25 # along with svndigest. If not, see <http://www.gnu.org/licenses/>. 28 26 29 27 # Run this to generate all auto-generated files needed by the GNU -
branches/replacing_gnuplot/configure.ac
r646 r784 13 13 # Copyright (C) 2006 Jari Häkkinen 14 14 # Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 15 # Copyright (C) 2009 Peter Johansson 15 16 # 16 # This file is part of svndigest, http:// trac.thep.lu.se/svndigest17 # This file is part of svndigest, http://dev.thep.lu.se/svndigest 17 18 # 18 19 # svndigest is free software; you can redistribute it and/or modify it 19 20 # under the terms of the GNU General Public License as published by 20 # the Free Software Foundation; either version 2of the License, or21 # the Free Software Foundation; either version 3 of the License, or 21 22 # (at your option) any later version. 22 23 # … … 27 28 # 28 29 # You should have received a copy of the GNU General Public License 29 # along with this program; if not, write to the Free Software 30 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 31 # 02111-1307, USA. 32 33 AC_PREREQ(2.60) 34 35 36 m4_include([./build_support/version.m4]) 30 # along with svndigest. If not, see <http://www.gnu.org/licenses/>. 31 32 AC_PREREQ(2.61) 33 34 m4_include([m4/version.m4]) 37 35 AC_INIT([svndigest],[SVNDIGEST_VERSION],[jari@thep.lu.se]) 38 36 AC_CONFIG_SRCDIR([lib/File.h]) 39 37 AC_CONFIG_AUX_DIR([autotools]) 38 dnl arg below should be the same as in Makefile.am 39 AC_CONFIG_MACRO_DIR([m4]) 40 40 AC_PREFIX_DEFAULT([/usr/local]) 41 test $prefix = NONE && prefix=/usr/local42 41 43 42 AC_SUBST([SVNDIGEST_MAJOR_VERSION], [MAJOR_VERSION]) … … 46 45 47 46 AC_DEFINE([DEV_BUILD],[SVNDIGEST_DEV_BUILD], 48 [true if dev build (version starts with pre)])49 AC_DEFINE([ VERSION_MAJOR], [SVNDIGEST_MAJOR_VERSION],47 [true if dev build (version ends with pre)]) 48 AC_DEFINE([SVNDIGEST_MAJOR_VERSION], [MAJOR_VERSION], 50 49 [Define to the svndigest major version]) 51 AC_DEFINE([ VERSION_MINOR], [SVNDIGEST_MINOR_VERSION],50 AC_DEFINE([SVNDIGEST_MINOR_VERSION], [MINOR_VERSION], 52 51 [Define to the svndigest minor version]) 53 AC_DEFINE([ VERSION_PATCH], [SVNDIGEST_PATCH_VERSION],52 AC_DEFINE([SVNDIGEST_PATCH_VERSION], [PATCH_VERSION], 54 53 [Define to the svndigest patch version]) 55 54 56 55 AC_CONFIG_HEADER([config.h]) 57 AM_INIT_AUTOMAKE([std-options check-news]) 58 59 # seems like these variables are not set with older autoconf(?) 60 AC_SUBST([abs_srcdir], ["`cd $srcdir && pwd`"]) 61 AC_SUBST([abs_builddir], ["`pwd`"]) 56 AM_INIT_AUTOMAKE([1.10 std-options check-news]) 62 57 63 58 # Set default programming language 64 59 AC_LANG(C++) 60 61 # propagate selected configure variables to DISTCHECK_CONFIGURE_FLAGS 62 for var in CPPFLAGS CXX CXXFLAGS CXXCPP LDFLAGS LIBS; do 63 eval isset=\${$var+set} 64 if test "$isset" = 'set' ; then 65 eval val=$`echo $var` 66 DISTCHECK_CONFIGURE_FLAGS="${DISTCHECK_CONFIGURE_FLAGS}'${var}=${val}' " 67 fi 68 done 69 AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) 65 70 66 71 # Let user overide default CXXFLAGS … … 68 73 CXXFLAGS="" # Setting CXXFLAGS here to prevent expansion in AC_PROG_CXX 69 74 fi 75 70 76 # Checks for programs. 71 77 AC_PROG_CXXCPP 72 78 AC_PROG_CXX 73 79 AC_PROG_INSTALL 74 AC_PROG_ LIBTOOL80 AC_PROG_RANLIB 75 81 AC_PROG_SED 76 AC_CHECK_PROG([GNUPLOT],[gnuplot],[ok]) 82 AC_PATH_PROG([HELP2MAN], [help2man], [no]) 83 AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN != xno]) 84 AC_PATH_PROG([GNUPLOT],[gnuplot],[no]) 85 AC_DEFINE_UNQUOTED([GNUPLOT_PATH], ["$GNUPLOT"], 86 [defined to gnuplot path (or no if gnuplot was not found)]) 77 87 78 88 # Save FLAGS … … 85 95 # using extension beyond the C++ standard (usage of non C++ standard 86 96 # 'long long' types). 87 SD_CXXFLAGS="$SD_CXXFLAGS-Wall -pedantic -Wno-long-long" 88 AC_TYPE_LONG_LONG_INT() 89 90 AC_ARG_ENABLE(debug, 97 YAT_CXX_ADD_FLAG([SD_CXXFLAGS],[-pedantic -Wno-long-long]) 98 AC_TYPE_LONG_LONG_INT 99 AS_IF([test x$ac_cv_type_long_long_int = xno], 100 [AC_MSG_ERROR([compiler does not support long long int])] 101 ) 102 103 AC_ARG_ENABLE([debug], 91 104 [AS_HELP_STRING([--enable-debug],[turn on debug options and code])], 92 [SD_CXXFLAGS="$SD_CXXFLAGS -g -O"], 93 [SD_CPPFLAGS="-DNDEBUG" SD_CXXFLAGS="$SD_CXXFLAGS -O3"]) 94 95 # optionally prepare for building static libraries. 96 AC_ARG_ENABLE(staticbin, 97 [AS_HELP_STRING([--enable-staticbin], [create a static binary, 98 at least as static as the available underlying libraries 99 allows])]) 100 if test "$enable_staticbin" = "yes"; then 101 case $host in 102 *-apple-darwin*) 103 # At the time of creating this libsvn_subr uses 104 # Keychain on Mac OSX. In consequence the below 105 # frameworks are needed for succesful static builds. 106 SD_LIBS="$SD_LIBS -framework Security" 107 SD_LIBS="$SD_LIBS -framework CoreFoundation" 108 SD_LIBS="$SD_LIBS -framework CoreServices" 109 ;; 110 esac 111 STATICFLAG=-static 112 AC_SUBST(STATICFLAG) 113 fi 105 [YAT_CXX_ADD_FLAG([SD_CXXFLAGS],[-g -O])], 106 [YAT_CPP_ADD_FLAG([SD_CPPFLAGS],[-DNDEBUG]) 107 YAT_CXX_ADD_FLAG([SD_CXXFLAGS],[-O3])]) 108 109 # enable svn-support 110 AC_ARG_ENABLE([svn-support], 111 [AS_HELP_STRING([--enable-svn-support], 112 [enable svn support - used by maintainer])]) 113 114 AS_IF([test "x$enable_svn-support" = xyes], 115 [AC_CHECK_FILE([$srcdir/.svn],, 116 [AC_MSG_ERROR([svn support cannot be enabled: `$srcdir' is not an svn wc.])])]) 117 AM_CONDITIONAL([ENABLE_SVN_SUPPORT], [test "x$enable_svn-support" = "xyes"]) 114 118 115 119 # Apache Portable Runtime (APR) API checks 116 # The next three lines are not needed as long as APR_FIND_APR is used.117 # AC_ARG_WITH(apr,118 # [ --with-apr=DIR prefix for installed APR or path to APR build119 # tree [[PREFIX]]])120 # Include APR_FIND_APR macro distributed within the APR project. If121 # the usage of the APR macro is to be omitted then the construct for122 # setting the CXXFLAGS (header file location) and LDFLAGS (linking123 # informaion) for APR must be changed. The latter can be achieved with124 # AC_SEARCH_LIBS([apr_allocator_create],[apr-0],,apr_found="no") but125 # apr-0 must be prior knowledge.126 m4_sinclude(./build_support/find_apr.m4)127 120 APR_FIND_APR(,,1,[1 0]) 121 AS_IF([test "${with_apr+set}" = set], 122 [DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-apr=$with_apr"] 123 ) 128 124 if test "$apr_found" = "yes" ; then 129 SD_LDFLAGS="`$apr_config --link-ld` $SD_LDFLAGS" 130 SD_CPPFLAGS="`$apr_config --includes --cppflags` $SD_CPPFLAGS" 125 SD_LIBS="`$apr_config --libs` $SD_LIBS" 126 apr_link_ld=`$apr_config --link-ld` 127 for i in $apr_link_ld; do 128 AS_IF([test ${i:0:2} = "-l"],[SD_LIBS="$i $SD_LIBS"], 129 [YAT_LD_ADD_FLAG([SD_LDFLAGS], [$i])]) 130 done 131 YAT_CPP_ADD_FLAG([SD_CPPFLAGS],[`$apr_config --includes --cppflags`]) 131 132 fi 132 133 … … 135 136 AC_ARG_WITH(svn, 136 137 [AS_HELP_STRING([--with-svn=DIR],[prefix for svn developer files [[PREFIX]]])], 137 [ SD_LDFLAGS="-L$withval/lib $SD_LDFLAGS" 138 SD_CPPFLAGS="-I$withval/include $SD_CPPFLAGS"]) 138 [ DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-svn=$withval" 139 YAT_LD_ADD_FLAG([SD_LDFLAGS], [-L$withval/lib]) 140 YAT_CPP_ADD_FLAG([SD_CPPFLAGS], [-L$withval/include]) 141 ]) 142 139 143 140 144 … … 147 151 AC_CHECK_HEADER([apr_allocator.h],,apr_found="no") 148 152 AC_CHECK_HEADER([subversion-1/svn_types.h],,svn_found="no") 149 # The library checks below may match shared libs even when150 # --enable-staticbin is given to configure. This should probably not151 # pose any problems since in a properly installed system the shared152 # and static libraries should be the same.153 153 AC_SEARCH_LIBS([svn_cmdline_setup_auth_baton],[svn_subr-1], 154 154 [SD_LIBS="-lsvn_subr-1 $SD_LIBS"],svn_found="no") … … 175 175 176 176 # check if svnversion is installed 177 have_svnversion="yes" 178 AC_PATH_PROG(SVNVERSION, svnversion, have_svnversion="no") 177 AC_PATH_PROG([SVNVERSION], [svnversion], [no]) 179 178 180 179 # checking if we build in a subversion WC 181 wc_found="no"; 182 if (test $have_svnversion != "no" && 183 test `$SVNVERSION -n $srcdir` != "exported"); 184 then 185 wc_found="yes"; 186 fi 187 AC_CHECK_FILE("$srcdir/lib/subversion_info.cc",info_found="yes",info_found="no") 188 189 # checking that DEV_BUILD is set to false at time of release 190 # Failure should be captured by distcheck 191 if (test "$wc_found" = "no" && test "$SVNDIGEST_DEV_BUILD" = "true") ; then 192 AC_MSG_ERROR([Incorrect version: 193 [SVNDIGEST_DEV_BUILD] is set to SVNDIGEST_DEV_BUILD. 194 [SVNDIGEST_DEV_BUILD] should be set to false at time of release. 195 Please, update version.m4.]) 196 fi 197 198 199 # devel version should have svn WC and SVNVERSION installed 200 AM_CONDITIONAL(HAVE_SVN_WC, test "$wc_found" = "yes" ) 180 AC_CHECK_FILE([$srcdir/.svn], [wc_found="yes"], [wc_found="no"]) 181 AM_CONDITIONAL([HAVE_SVN_WC], [test "$wc_found" = "yes"]) 182 AC_SUBST([wc_found]) 183 184 # checking if we have test repo 185 test_repo_filename=$srcdir/test/repo; 186 AC_CHECK_FILE([$test_repo_filename], 187 [AC_DEFINE([HAVE_TEST_REPO],[1],[define if test repo is available]) 188 test_repo_found="yes"], 189 [test_repo_found="no"]) 190 AC_SUBST([test_repo_found]) 191 AS_IF([test "x$test_repo_found" = xyes], 192 [abs_test_repo=`cd $test_repo_filename && pwd`; 193 AC_SUBST(abs_test_repo)] 194 ) 195 AC_CONFIG_FILES([test/test_repo.sh], [chmod +x test/test_repo.sh]) 196 AC_CONFIG_FILES([test/svn_update.sh], [chmod +x test/svn_update.sh]) 197 AC_CONFIG_FILES([test/check_repo_status.sh], 198 [chmod +x test/check_repo_status.sh]) 201 199 202 200 … … 204 202 bin/Makefile 205 203 lib/Makefile 204 man/Makefile 206 205 test/environment.h 207 206 test/Makefile]) … … 214 213 all_reqs_ok="true" 215 214 216 if (test "$wc_found" != "yes") ; then 217 if (test "$info_found" = "no") ; then 218 AC_MSG_WARN([Cannot find sources (lib/subversion_info.cc).]) 219 if (test "$svnversion" = "no") ; then 220 AC_MSG_WARN([If you grabbed the source from the subversion repository, 221 the file will be generated automatically. However, svnversion cannot 222 be found and therefore the file cannot be generated. Please install 223 svnversion and make sure it is in your search path.]) 224 else 225 AC_MSG_WARN([If you grabbed the source from the subversion repository, 226 the file will be generated automatically. However, the output from 227 svnversion was incorrect. Either your installation of svnversion is 228 is not healthy or there is something wrong with the repository.]) 229 fi 230 all_reqs_ok="false" 231 else 232 dnl test repo is not distributed 233 AC_CONFIG_FILES([test/test_repo.sh 234 test/check_repo_status.sh], 235 [chmod +x test/test_repo.sh; 236 chmod +x test/check_repo_status.sh]) 237 238 fi 215 if (test "$wc_found" = "yes"); then 216 if test x$HELP2MAN = xno; then 217 AC_MSG_WARN(m4_text_wrap(m4_normalize([ 218 `help2man' is missing on your system. You will not be 219 able to create the man page. A sound man page should be 220 included in a distribution, and since you will not able 221 to create a complete distribution `make dist' will fail. 222 ]),[ ], 223 [ ], 79)) 224 fi 225 # svnversion is required when building from svn wc 226 if (test "$svnversion" = "no"); then 227 all_reqs_ok="false"; 228 AC_MSG_WARN([dnl 229 Cannot find svnversion, which is required when building from a 230 subversion working copy. Please install svnversion and make sure it is 231 in your search path.]); 232 fi 233 if (test "$test_repo_found" = "no"); then 234 all_reqs_ok="false"; 235 AC_MSG_WARN([dnl 236 Cannot find test repository (test_repo_filename), which should be 237 available when building from a subversion working copy. Try svn 238 update in top directory.]); 239 fi 239 240 fi 240 241 241 242 # Non-existing APR is fatal -- sub-sequent compilation will fail. 242 243 if (test "$apr_found" = "no") ; then 243 244 245 246 244 AC_MSG_WARN([APR not found. The Apache Portable Runtime 245 (APR) library cannot be found. Please make sure APR is installed 246 and supply the appropriate --with-apr option to 'configure'.]) 247 all_reqs_ok="false" 247 248 fi 248 249 249 250 # Non-existing subversion API is fatal -- sub-sequent compilation will fail. 250 251 if (test "$svn_found" = "no") ; then 251 252 253 254 if (test "$apr_found" = "no") ; then252 svn_msg="Subversion API not found. Subversion API libraries cannot 253 be found. Make sure the APIs are installed and supply the 254 appropriate --with-svn option to 'configure'." 255 if (test "$apr_found" = "no") ; then 255 256 svn_msg="$svn_msg 256 257 Note, APR was not found. Failure to locate APR affects the search 257 258 of the subversion API. Please fix the APR problem before trying 258 259 to resolve the subversion related issues." 259 fi260 261 260 fi 261 AC_MSG_WARN([$svn_msg]) 262 all_reqs_ok="false" 262 263 fi 263 264 264 265 if test $ac_cv_type_long_long_int != yes ; then 265 266 267 266 AC_MSG_WARN([Compiler $CXX does not support `long long'. 267 svndigest must be compiled with a compiler that supports `long long'.]) 268 all_reqs_ok="false" 268 269 fi 269 270 270 271 if (test "$all_reqs_ok" = "false") ; then 271 272 273 274 272 AC_MSG_ERROR([Some pre-requisites were not fulfilled, aborting 273 configure. Please consult the 'README' file for more information 274 about what is needed to compile svndigest and refer to above 275 warning messages. Needed files were NOT created.]) 275 276 fi 276 277 … … 292 293 293 294 # Failure to locate gnuplot is not considered fatal 294 if (test "$GNUPLOT" != "ok") ; then 295 AC_MSG_WARN([Gnuplot was not found. svndigest will compile 296 without gnuplot but will throw an exception at run-time. Please 297 install gnuplot (available for a wide range of operating systems 298 at http://www.gnuplot.info).]) 299 AC_MSG_NOTICE([]) 300 fi 301 302 if test "$enable_staticbin" = "yes"; then 303 AC_MSG_NOTICE([A statically linked 'svndigest' binary will be created.]) 304 else 305 AC_MSG_NOTICE([A dynamically linked 'svndigest' binary will be created.]) 306 fi 307 AC_MSG_NOTICE([]) 308 309 AC_MSG_NOTICE([Now type 'make ; make check'.]) 310 295 if (test "x$GNUPLOT" = "xno") ; then 296 AC_MSG_WARN([Gnuplot was not found. svndigest will compile 297 without gnuplot but will throw an exception at run-time. Please 298 install gnuplot (available for a wide range of operating systems 299 at http://www.gnuplot.info).]) 300 AC_MSG_NOTICE([]) 301 fi 302 303 AC_MSG_NOTICE([Now type 'make && make check'.]) -
branches/replacing_gnuplot/doc/readme.txt
r526 r784 23 23 still are in use. 24 24 25 see also: http:// trac.thep.lu.se/svndigest/wiki/StatsType25 see also: http://dev.thep.lu.se/svndigest/wiki/StatsType 26 26 27 27 == Different linetypes == … … 58 58 For a more detailed illustration, please have a look at `config` that 59 59 can be found in directory `.svndigest`, and the svndigest screenshots 60 that can be reached through http:// trac.thep.lu.se/svndigest/.60 that can be reached through http://dev.thep.lu.se/svndigest/. 61 61 62 62 Sometimes it might be useful if a file could be parsed as though it … … 81 81 and symbolic links as zero-line files. There is a possibility to 82 82 exclude files from the statistics, the use of the property 83 svndigest:ignore. 83 svndigest:ignore. 84 84 85 85 Sometimes large test files and XML files are added to the repository … … 89 89 directory will exclude all siblings to that directory from svndigest 90 90 treatment. 91 92 To set the property on file `FILE`, issue `svn propset 93 svndigest:ignore "" FILE`. For more detailed information refer to 94 http://svnbook.red-bean.com/. 91 95 92 96 == Configuration == … … 164 168 Copyright (C) 2005 Jari Häkkinen 165 169 Copyright (C) 2006 Jari Häkkinen, Peter Johansson 166 Copyright (C) 2007 Peter Johansson170 Copyright (C) 2007, 2008 Peter Johansson 167 171 168 This file is part of svndigest, http:// trac.thep.lu.se/svndigest172 This file is part of svndigest, http://dev.thep.lu.se/svndigest 169 173 170 174 svndigest is free software; you can redistribute it and/or modify it 171 175 under the terms of the GNU General Public License as published by the 172 Free Software Foundation; either version 2of the License, or (at your176 Free Software Foundation; either version 3 of the License, or (at your 173 177 option) any later version. 174 178 … … 179 183 180 184 You should have received a copy of the GNU General Public License 181 along with this program; if not, write to the Free Software 182 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 183 USA. 185 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 184 186 }}} 185 186 -
branches/replacing_gnuplot/lib/AddStats.cc
r646 r784 4 4 Copyright (C) 2008 Peter Johansson 5 5 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest6 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 7 8 8 svndigest is free software; you can redistribute it and/or modify it 9 9 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 … … 17 17 18 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 19 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 20 */ 23 21 … … 31 29 #include <cassert> 32 30 #include <cstdlib> 31 #include <functional> 33 32 #include <map> 34 33 #include <string> … … 54 53 55 54 56 void AddStats::do_parse(const std::string& path )55 void AddStats::do_parse(const std::string& path, svn_revnum_t rev) 57 56 { 58 LineTypeParser parser(path);59 57 SVNlog log(path); 60 typedef std::set<svn_revnum_t > RevSet;58 typedef std::set<svn_revnum_t, std::greater<svn_revnum_t> > RevSet; 61 59 RevSet revs; 62 60 std::transform(log.commits().begin(), log.commits().end(), 63 std::inserter(revs, revs.begin()), GetRevision()); 64 for (RevSet::iterator rev_iter=revs.begin();rev_iter!=revs.end();++rev_iter){ 61 std::inserter(revs, revs.begin()), 62 std::mem_fun_ref(&Commitment::revision)); 63 for (RevSet::iterator rev_iter=revs.begin(); 64 rev_iter!=revs.end() && *rev_iter>=rev; ++rev_iter){ 65 65 SVNblame svn_blame(path, *rev_iter); 66 LineTypeParser parser(path); 66 67 while (svn_blame.valid()) { 68 LineTypeParser::line_type lt = parser.parse(svn_blame.line()); 67 69 if (*rev_iter==svn_blame.revision()) 68 add(svn_blame.author(), *rev_iter, parser.parse(svn_blame.line()));70 add(svn_blame.author(), *rev_iter, lt); 69 71 // I dont trust blame and log behave consistent (stop-on-copy). 70 72 revs.insert(svn_blame.revision()); … … 72 74 } 73 75 } 74 75 accumulate_stats(); 76 accumulate_stats(rev); 76 77 } 77 78 -
branches/replacing_gnuplot/lib/AddStats.h
r543 r784 7 7 Copyright (C) 2008 Peter Johansson 8 8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 … … 44 42 45 43 private: 46 void do_parse(const std::string& );44 void do_parse(const std::string&, svn_revnum_t); 47 45 48 46 }; -
branches/replacing_gnuplot/lib/Alias.cc
r519 r784 2 2 3 3 /* 4 Copyright (C) 2007 Peter Johansson4 Copyright (C) 2007, 2008 Peter Johansson 5 5 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest6 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 7 8 8 svndigest is free software; you can redistribute it and/or modify it 9 9 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 … … 17 17 18 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 19 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 20 */ 23 21 -
branches/replacing_gnuplot/lib/Alias.h
r519 r784 5 5 6 6 /* 7 Copyright (C) 2007 Peter Johansson7 Copyright (C) 2007, 2008 Peter Johansson 8 8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 -
branches/replacing_gnuplot/lib/BlameStats.cc
r646 r784 5 5 Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson 6 6 7 This file is part of svndigest, http:// trac.thep.lu.se/svndigest7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 8 9 9 svndigest is free software; you can redistribute it and/or modify it 10 10 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 12 12 (at your option) any later version. 13 13 … … 18 18 19 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 21 */ 24 22 … … 26 24 27 25 #include "Functor.h" 28 #include "GnuplotFE.h"29 26 #include "SVNblame.h" 30 27 #include "SVNinfo.h" … … 36 33 #include <cstdlib> 37 34 #include <fstream> 35 #include <functional> 38 36 #include <iostream> 39 37 #include <iterator> … … 76 74 77 75 78 void BlameStats::do_parse(const std::string& path )76 void BlameStats::do_parse(const std::string& path, svn_revnum_t first_rev) 79 77 { 80 LineTypeParser parser(path);81 78 SVNlog log(path); 82 79 typedef std::set<svn_revnum_t> RevSet; 83 80 RevSet revs; 84 81 std::transform(log.commits().begin(), log.commits().end(), 85 std::inserter(revs, revs.begin()), GetRevision()); 86 for (RevSet::iterator rev_iter=revs.begin();rev_iter!=revs.end();++rev_iter){ 82 std::inserter(revs, revs.begin()), 83 std::mem_fun_ref(&Commitment::revision)); 84 for (RevSet::reverse_iterator rev_iter=revs.rbegin(); 85 rev_iter!=revs.rend() && *rev_iter>=first_rev; ++rev_iter){ 87 86 SVNblame svn_blame(path, *rev_iter); 87 LineTypeParser parser(path); 88 88 while (svn_blame.valid()) { 89 89 add(svn_blame.author(), *rev_iter, parser.parse(svn_blame.line())); … … 96 96 // filling in pristine revisions 97 97 RevSet::iterator rev_iter=revs.begin(); 98 for (svn_revnum_t rev = 1; rev<=revision(); ++rev){98 for (svn_revnum_t rev = first_rev+1; rev<=revision(); ++rev){ 99 99 if (rev==*rev_iter) 100 100 ++rev_iter; -
branches/replacing_gnuplot/lib/BlameStats.h
r537 r784 9 9 Copyright (C) 2007 Peter Johansson 10 10 11 This file is part of svndigest, http:// trac.thep.lu.se/svndigest11 This file is part of svndigest, http://dev.thep.lu.se/svndigest 12 12 13 13 svndigest is free software; you can redistribute it and/or modify it 14 14 under the terms of the GNU General Public License as published by 15 the Free Software Foundation; either version 2of the License, or15 the Free Software Foundation; either version 3 of the License, or 16 16 (at your option) any later version. 17 17 … … 22 22 23 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 26 02111-1307, USA. 24 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 27 25 */ 28 26 … … 46 44 47 45 private: 48 void do_parse(const std::string& );46 void do_parse(const std::string&, svn_revnum_t); 49 47 void fill_in(Author2Vector&, svn_revnum_t rev); 50 48 -
branches/replacing_gnuplot/lib/ClassicStats.cc
r552 r784 5 5 Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson 6 6 7 This file is part of svndigest, http:// trac.thep.lu.se/svndigest7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 8 9 9 svndigest is free software; you can redistribute it and/or modify it 10 10 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 12 12 (at your option) any later version. 13 13 … … 18 18 19 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 21 */ 24 22 … … 26 24 27 25 #include "Functor.h" 28 #include "GnuplotFE.h"29 26 #include "SVNblame.h" 30 27 #include "SVNinfo.h" … … 62 59 63 60 64 void ClassicStats::do_parse(const std::string& path )61 void ClassicStats::do_parse(const std::string& path, svn_revnum_t rev) 65 62 { 66 63 LineTypeParser parser(path); 67 64 SVNblame svn_blame(path); 68 65 while (svn_blame.valid()) { 69 add(svn_blame.author(), svn_blame.revision(), 70 parser.parse(svn_blame.line())); 66 if (svn_blame.revision()>=rev) { 67 add(svn_blame.author(), svn_blame.revision(), 68 parser.parse(svn_blame.line())); 69 } 71 70 svn_blame.next_line(); 72 71 } 73 accumulate_stats(); 74 72 accumulate_stats(rev); 75 73 } 76 74 -
branches/replacing_gnuplot/lib/ClassicStats.h
r531 r784 9 9 Copyright (C) 2007 Peter Johansson 10 10 11 This file is part of svndigest, http:// trac.thep.lu.se/svndigest11 This file is part of svndigest, http://dev.thep.lu.se/svndigest 12 12 13 13 svndigest is free software; you can redistribute it and/or modify it 14 14 under the terms of the GNU General Public License as published by 15 the Free Software Foundation; either version 2of the License, or15 the Free Software Foundation; either version 3 of the License, or 16 16 (at your option) any later version. 17 17 … … 22 22 23 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 26 02111-1307, USA. 24 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 27 25 */ 28 26 … … 46 44 47 45 private: 48 void do_parse(const std::string& );46 void do_parse(const std::string&, svn_revnum_t); 49 47 50 48 }; -
branches/replacing_gnuplot/lib/ColumnStream.cc
r519 r784 2 2 3 3 /* 4 Copyright (C) 2007 Peter Johansson4 Copyright (C) 2007, 2008 Peter Johansson 5 5 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest6 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 7 8 8 svndigest is free software; you can redistribute it and/or modify it 9 9 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 … … 17 17 18 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 19 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 20 */ 23 21 -
branches/replacing_gnuplot/lib/ColumnStream.h
r646 r784 5 5 6 6 /* 7 Copyright (C) 2007 Peter Johansson7 Copyright (C) 2007, 2008 Peter Johansson 8 8 Copyright (C) 2008 Jari Häkkinen 9 9 10 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 11 11 12 12 svndigest is free software; you can redistribute it and/or modify it 13 13 under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 15 15 (at your option) any later version. 16 16 … … 21 21 22 22 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 25 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 26 24 */ 27 25 -
branches/replacing_gnuplot/lib/Commitment.cc
r646 r784 2 2 3 3 /* 4 Copyright (C) 2007 Peter Johansson4 Copyright (C) 2007, 2008 Peter Johansson 5 5 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest6 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 7 8 8 svndigest is free software; you can redistribute it and/or modify it 9 9 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 … … 17 17 18 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 19 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 20 */ 23 21 -
branches/replacing_gnuplot/lib/Commitment.h
r646 r784 5 5 6 6 /* 7 Copyright (C) 2007 Peter Johansson7 Copyright (C) 2007, 2008 Peter Johansson 8 8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 … … 93 91 }; 94 92 95 struct GetAuthor93 struct LessRevision 96 94 { 97 inline const std::string& operator()(const Commitment& commit) const 98 { return commit.author(); } 99 }; 100 101 struct GetRevision 102 { 103 inline svn_revnum_t operator()(const Commitment& commit) const 104 { return commit.revision(); } 95 inline bool operator()(const Commitment& lhs, const Commitment& rhs) 96 { return lhs.revision()<rhs.revision(); } 105 97 }; 106 98 -
branches/replacing_gnuplot/lib/Configuration.cc
r556 r784 2 2 3 3 /* 4 Copyright (C) 2007 Peter Johansson 5 6 This file is part of svndigest, http://trac.thep.lu.se/svndigest 4 Copyright (C) 2007, 2008 Peter Johansson 5 Copyright (C) 2008 Jari Häkkinen 6 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 8 8 9 svndigest is free software; you can redistribute it and/or modify it 9 10 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 11 12 (at your option) any later version. 12 13 … … 17 18 18 19 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 21 */ 23 22 … … 168 167 } 169 168 else if (section == "copyright") { 170 if (lhs=="missing-copyright-warning") 169 if (lhs=="missing-copyright-warning") { 171 170 if (equal_false(rhs)) 172 171 missing_copyright_warning_ = false; … … 176 175 throw Config_error(line, ""); 177 176 } 177 } 178 178 } 179 179 else if (section == "parsing-codons") { … … 353 353 add_codon("*.ac", "dnl", "\n"); 354 354 add_codon("*.am", "#", "\n"); 355 add_codon("*.am", "dnl", "\n");356 355 add_codon("*.m4", "#", "\n"); 357 356 add_codon("*.m4", "dnl", "\n"); … … 459 458 << "# If trac-root is set, svndigest will create anchors to " 460 459 << "the Trac page.\n" 461 << "# trac-root = http:// trac.thep.lu.se/svndigest/\n";460 << "# trac-root = http://dev.thep.lu.se/svndigest/\n"; 462 461 if (!conf.trac_root().empty()) 463 462 os << "trac-root = " << conf.trac_root() << "\n"; … … 466 465 os << "\n" 467 466 << "### Section for setting dictionary for file names.\n" 468 << "### Prior looking for file name pattern in section [codon],\n" 467 << "### Prior looking for file name pattern in section " 468 << "[parsing-codons],\n" 469 469 << "### the file name may be translated according to the rules \n" 470 470 << "### in this section. In default setting there is, for example,\n" -
branches/replacing_gnuplot/lib/Configuration.h
r556 r784 5 5 6 6 /* 7 Copyright (C) 2007 Peter Johansson7 Copyright (C) 2007, 2008 Peter Johansson 8 8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 … … 71 69 /// 72 70 /// @return root for the trac envrionment, e.g., 73 /// http:// trac.thep.lu.se/svndigest/71 /// http://dev.thep.lu.se/svndigest/ 74 72 /// 75 73 std::string trac_root(void) const; -
branches/replacing_gnuplot/lib/Date.cc
r589 r784 3 3 /* 4 4 Copyright (C) 2007 Peter Johansson 5 Copyright (C) 2008 Jari Häkkinen, Peter Johansson 6 Copyright (C) 2009 Peter Johansson 5 7 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 9 8 10 svndigest is free software; you can redistribute it and/or modify it 9 11 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 11 13 (at your option) any later version. 12 14 … … 17 19 18 20 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 22 */ 23 23 … … 25 25 26 26 #include <algorithm> 27 #include <cassert> 28 #include <ctime> 27 29 #include <sstream> 30 #include <stdexcept> 28 31 #include <string> 29 32 30 33 namespace theplu { 31 34 namespace svndigest { 32 33 static const char* wdays_[7] = {34 "Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday",35 "Saturday"36 };37 38 39 static const char* month_[12] = {40 "January", "February", "March", "April", "May", "June", "July", "August",41 "September", "October", "November", "December"42 };43 44 35 45 36 Date::Date(void) … … 153 144 std::stringstream ss; 154 145 struct tm* timeinfo = std::gmtime(&time_); 155 for (std::string::iterator i=format.begin(); i!=format.end(); ++i) { 156 if (*i == '%' && ++i !=format.end()) { 157 if (*i == 'a') 158 ss << std::string(wdays_[timeinfo->tm_wday]).substr(0,3); 159 else if (*i == 'A') 160 ss << wdays_[timeinfo->tm_wday]; 161 else if (*i == 'b') 162 ss << std::string(month_[timeinfo->tm_mon]).substr(0,3); 163 else if (*i == 'B') 164 ss << month_[timeinfo->tm_mon]; 165 else if (*i == 'd') 166 ss << timeinfo->tm_mday; 167 else if (*i == 'e') { 168 if (timeinfo->tm_mday<10) 169 ss << "0"; 170 ss << timeinfo->tm_mday; 171 } 172 else if (*i == 'H') { 173 if (timeinfo->tm_hour<10) 174 ss << "0"; 175 ss << timeinfo->tm_hour; 176 } 177 else if (*i == 'I') { 178 int tmp = (timeinfo->tm_hour + 11) % 12 + 1; 179 if (tmp<10) 180 ss << "0"; 181 ss << tmp; 182 } 183 else if (*i == 'j') 184 ss << timeinfo->tm_yday+1; 185 else if (*i == 'm') { 186 if (timeinfo->tm_mon<9) 187 ss << "0"; 188 ss << timeinfo->tm_mon+1; 189 } 190 else if (*i == 'M') { 191 if (timeinfo->tm_min<10) 192 ss << "0"; 193 ss << timeinfo->tm_min; 194 } 195 else if (*i == 'P') 196 if (timeinfo->tm_hour<12) 197 ss << "AM"; 198 else 199 ss << "PM"; 200 else if (*i == 'S') { 201 if (timeinfo->tm_sec<10) 202 ss << "0"; 203 ss << timeinfo->tm_sec; 204 } 205 else if (*i == 'w') 206 if (timeinfo->tm_wday==0) 207 ss << "7"; 208 else 209 ss << timeinfo->tm_wday; 210 else if (*i == 'y') { 211 int y(timeinfo->tm_year % 100); 212 if (y<10) 213 ss << "0"; 214 ss << y; 215 } 216 else if (*i == 'Y') 217 ss << timeinfo->tm_year+1900; 218 else if (*i == 'Z') 219 ss << timeinfo->tm_zone; 220 else { 221 ss << '%'; 222 --i; 223 } 224 } 225 else 226 ss << *i; 146 char buffer[80]; 147 size_t res = std::strftime(buffer, 80, format.c_str(), timeinfo); 148 if (!res) { 149 throw std::runtime_error("svndigest::Date::operator() failed"); 227 150 } 228 229 return ss.str(); 151 return buffer; 230 152 } 231 153 -
branches/replacing_gnuplot/lib/Date.h
r519 r784 5 5 6 6 /* 7 Copyright (C) 2007 Peter Johansson7 Copyright (C) 2007, 2008 Peter Johansson 8 8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 -
branches/replacing_gnuplot/lib/Directory.cc
r589 r784 3 3 /* 4 4 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 5 6 This file is part of svndigest, http://trac.thep.lu.se/svndigest 5 Copyright (C) 2009 Peter Johansson 6 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 8 8 9 svndigest is free software; you can redistribute it and/or modify it 9 10 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 11 12 (at your option) any later version. 12 13 … … 17 18 18 19 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 21 */ 23 22 … … 89 88 } 90 89 } 91 daughters_.sort(NodePtrLess());90 std::sort(daughters_.begin(), daughters_.end(), NodePtrLess()); 92 91 } 93 92 … … 110 109 111 110 112 SVNlog Directory::log_core(void) const 113 { 114 SVNlog log(path()); 111 void Directory::log_core(SVNlog& log) const 112 { 115 113 for (NodeConstIterator i(daughters_.begin()); i != daughters_.end(); ++i) 116 114 log += (*i)->log(); 117 return log;118 115 } 119 116 … … 142 139 void Directory::print_core(const bool verbose) const 143 140 { 141 mkdir("blame_output/" + local_path_); 144 142 // print daughter nodes, i.e., this function is recursive 145 143 for (NodeConstIterator i=daughters_.begin(); i!=daughters_.end(); ++i) … … 255 253 256 254 void Directory::print_copyright(std::map<std::string, Alias>& alias, 257 bool verbose) const { 255 bool verbose, 256 const std::map<int,svn_revnum_t>& y2r) const { 258 257 if (!ignore()){ 259 258 // print daughter nodes, i.e, this function is recursive 260 259 for (NodeConstIterator i = daughters_.begin(); i!=daughters_.end(); ++i) 261 (*i)->print_copyright(alias, verbose );260 (*i)->print_copyright(alias, verbose, y2r); 262 261 } 263 262 } -
branches/replacing_gnuplot/lib/Directory.h
r589 r784 6 6 /* 7 7 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2009 Peter Johansson 8 9 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 11 12 svndigest is free software; you can redistribute it and/or modify it 12 13 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 14 15 (at your option) any later version. 15 16 … … 20 21 21 22 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 */ 26 25 27 26 #include "Node.h" 28 27 29 #include <list>30 28 #include <map> 31 29 #include <string> 30 #include <vector> 32 31 33 32 namespace theplu{ … … 83 82 const StatsCollection& parse(bool verbose, bool ignore); 84 83 85 void print_copyright(std::map<std::string, Alias>&, bool verbose) const; 84 using Node::print_copyright; 85 /** 86 virtual function typically called from Node::print_copyright 87 */ 88 void print_copyright(std::map<std::string, Alias>&, bool verbose, 89 const std::map<int, svn_revnum_t>&) const; 86 90 87 91 private: 88 92 /** 89 @returnunion of logs from daughter nodes.93 add union of logs from daughter nodes. 90 94 */ 91 SVNlog log_core(void) const;95 void log_core(SVNlog&) const; 92 96 93 97 /// … … 102 106 103 107 104 typedef std:: list<Node*> NodeContainer;108 typedef std::vector<Node*> NodeContainer; 105 109 typedef NodeContainer::iterator NodeIterator; 106 110 typedef NodeContainer::const_iterator NodeConstIterator; -
branches/replacing_gnuplot/lib/File.cc
r646 r784 3 3 /* 4 4 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 5 6 This file is part of svndigest, http://trac.thep.lu.se/svndigest 5 Copyright (C) 2009 Peter Johansson 6 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 8 8 9 svndigest is free software; you can redistribute it and/or modify it 9 10 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 11 12 (at your option) any later version. 12 13 … … 17 18 18 19 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 21 */ 23 22 … … 59 58 60 59 60 std::string File::blame_output_file_name(void) const 61 { 62 return "blame_output/" + local_path() + ".html"; 63 } 64 65 61 66 std::map<int, std::set<Alias> > 62 File::copyright_map(std::map<std::string, Alias>& alias) const 67 File::copyright_map(std::map<std::string, Alias>& alias, 68 const std::map<int, svn_revnum_t>& year2rev) const 63 69 { 64 70 using namespace std; 65 71 map<int, set<Alias> > year_authors; 66 SVNlog log(path());67 72 const Stats& stats = stats_["add"]; 68 69 typedef std::vector<Commitment>::iterator LogIterator; 70 for (LogIterator i=log.commits().begin(); i<log.commits().end(); ++i){ 71 if (i->revision() && 72 (stats(LineTypeParser::code, i->author(), i->revision()) > 73 stats(LineTypeParser::code, i->author(), i->revision()-1) || 74 stats(LineTypeParser::comment, i->author(), i->revision()) > 75 stats(LineTypeParser::comment, i->author(), i->revision()-1)) 76 ) { 73 74 // loop over all years 75 for (std::map<int, svn_revnum_t>::const_iterator rev_iter=year2rev.begin(); 76 rev_iter!=year2rev.end(); ++rev_iter) { 77 78 svn_revnum_t last_rev_this_year = rev_iter->second; 79 svn_revnum_t last_rev_last_year = 0; 80 if (rev_iter != year2rev.begin()) { 81 last_rev_last_year = (--rev_iter)->second; 82 ++rev_iter; 83 } 84 // loop over authors 85 for (std::set<std::string>::const_iterator a_iter=stats.authors().begin(); 86 a_iter!=stats.authors().end(); ++a_iter) { 87 88 // check if anything has been added since last year 89 if ( (stats(LineTypeParser::code, *a_iter, last_rev_this_year) > 90 stats(LineTypeParser::code, *a_iter, last_rev_last_year)) || 91 (stats(LineTypeParser::comment, *a_iter, last_rev_this_year) > 92 stats(LineTypeParser::comment, *a_iter, last_rev_last_year)) ) { 77 93 78 time_t sec = str2time(i->date());79 tm* timeinfo = gmtime(&sec);80 94 81 // find username in map of aliases 82 std::map<string,Alias>::iterator name(alias.lower_bound(i->author())); 83 84 // if alias exist insert alias 85 if (name != alias.end() && name->first==i->author()) 86 year_authors[timeinfo->tm_year].insert(name->second); 87 else { 88 // else insert user name 89 Alias a(i->author(),alias.size()); 90 year_authors[timeinfo->tm_year].insert(a); 91 std::cerr << "svndigest: warning: no copyright alias found for `" 92 << i->author() << "'\n"; 93 // insert alias to avoid multiple warnings. 94 alias.insert(name, std::make_pair(i->author(), a)); 95 // find username in map of aliases 96 std::map<string,Alias>::iterator name(alias.lower_bound(*a_iter)); 97 98 // if alias exist insert alias 99 if (name != alias.end() && name->first==*a_iter) 100 year_authors[rev_iter->first].insert(name->second); 101 else { 102 // else insert user name 103 Alias a(*a_iter,alias.size()); 104 year_authors[rev_iter->first].insert(a); 105 std::cerr << "svndigest: warning: no copyright alias found for `" 106 << *a_iter << "'\n"; 107 // insert alias to avoid multiple warnings. 108 alias.insert(name, std::make_pair(*a_iter, a)); 109 } 95 110 } 96 111 } … … 159 174 160 175 161 SVNlog File::log_core(void) const 162 { 163 return SVNlog(path()); 176 void File::log_core(SVNlog&) const 177 { 164 178 } 165 179 … … 186 200 if (!ignore && node_exist(cache_file)){ 187 201 std::ifstream is(cache_file.c_str()); 188 if (stats_.load_cache(is)){ 202 if (stats_.load_cache(is)) { 203 is.close(); 189 204 return stats_; 190 205 } 191 206 is.close(); 192 207 } 193 else {208 else 194 209 stats_.parse(path_); 195 }196 210 if (!node_exist(cache_dir)) 197 211 mkdir(cache_dir); 198 std::ofstream os(cache_file.c_str()); 212 std::string tmp_cache_file(cache_file+"~"); 213 std::ofstream os(tmp_cache_file.c_str()); 199 214 stats_.print(os); 200 215 os.close(); 216 rename(tmp_cache_file.c_str(), cache_file.c_str()); 201 217 return stats_; 202 218 } … … 205 221 void File::print_blame(std::ofstream& os) const 206 222 { 207 os << "<br /><h3> Blame Information</h3>";223 os << "<br /><h3>" << local_path() << "</h3>"; 208 224 os << "<table class=\"blame\">\n"; 209 225 os << "<thead>\n"; … … 286 302 287 303 void File::print_copyright(std::map<std::string, Alias>& alias, 288 bool verbose) const 304 bool verbose, 305 const std::map<int,svn_revnum_t>& y2rev) const 289 306 { 290 307 if (ignore()) … … 301 318 return; 302 319 } 303 std::map<int, std::set<Alias> > map=copyright_map(alias );320 std::map<int, std::set<Alias> > map=copyright_map(alias, y2rev); 304 321 std::string new_block = copyright_block(map, prefix); 305 322 if (old_block==new_block) … … 313 330 void File::print_core(const bool verbose) const 314 331 { 332 std::ofstream os(blame_output_file_name().c_str()); 333 assert(os.good()); 334 print_html_start(os, "svndigest", level_+1); 335 print_blame(os); 336 print_footer(os); 337 os.close(); 315 338 } 316 339 … … 343 366 print_author_summary(os, stats_[stats_type], line_type, log); 344 367 os << "\n"; 345 346 print_blame(os); 368 os << "<h3>" 369 << anchor(blame_output_file_name(), 370 "Blame Information", level_+3) 371 << "</h3>\n"; 347 372 348 373 print_footer(os); -
branches/replacing_gnuplot/lib/File.h
r589 r784 6 6 /* 7 7 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2009 Peter Johansson 8 9 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 11 12 svndigest is free software; you can redistribute it and/or modify it 12 13 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 14 15 (at your option) any later version. 15 16 … … 20 21 21 22 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 */ 26 25 … … 66 65 const StatsCollection& parse(bool verbose, bool ignore); 67 66 67 using Node::print_copyright; 68 68 /** 69 69 @throw std::runtime_error when a file error is encountered 70 70 updating the copyrights. 71 71 */ 72 void print_copyright(std::map<std::string, Alias>&, bool verbose) const; 72 void print_copyright(std::map<std::string, Alias>&, bool verbose, 73 const std::map<int, svn_revnum_t>&) const; 73 74 74 75 private: 76 std::string blame_output_file_name(void) const; 77 75 78 /** 76 @return log of this File.79 do nothing 77 80 */ 78 SVNlog log_core(void) const;81 void log_core(SVNlog&) const; 79 82 80 83 /// … … 100 103 */ 101 104 std::map<int, std::set<Alias> > 102 copyright_map(std::map<std::string, Alias>& alias) const; 105 copyright_map(std::map<std::string, Alias>& alias, 106 const std::map<int, svn_revnum_t>&) const; 103 107 104 108 /** -
branches/replacing_gnuplot/lib/Functor.cc
r519 r784 4 4 Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson 5 5 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest6 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 7 8 8 svndigest is free software; you can redistribute it and/or modify it 9 9 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 … … 17 17 18 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 19 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 20 */ 23 21 -
branches/replacing_gnuplot/lib/Functor.h
r519 r784 6 6 /* 7 7 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 8 9 This file is part of svndigest, http://trac.thep.lu.se/svndigest 8 Copyright (C) 2008 Jari Häkkinen 9 10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 11 12 svndigest is free software; you can redistribute it and/or modify it 12 13 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 14 15 (at your option) any later version. 15 16 … … 20 21 21 22 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 */ 26 25 27 //#include <algorithm>26 #include <algorithm> 28 27 #include <functional> 29 //#include <iosfwd>30 28 #include <string> 31 29 #include <utility> -
branches/replacing_gnuplot/lib/Gnuplot.cc
r519 r784 4 4 Copyright (C) 2006 Jari Häkkinen, Peter Johansson 5 5 Copyright (C) 2007 Peter Johansson 6 Copyright (C) 2008 Jari Häkkinen, Peter Johansson 6 7 7 This file is part of svndigest, http:// trac.thep.lu.se/svndigest8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 9 9 10 svndigest is free software; you can redistribute it and/or modify it 10 11 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 12 13 (at your option) any later version. 13 14 … … 18 19 19 20 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 22 */ 23 24 #include <config.h> 24 25 25 26 #include "Gnuplot.h" 26 27 27 28 #include <cstdio> 29 #include <cstdlib> 28 30 #include <string> 29 31 #include <unistd.h> … … 58 60 void Gnuplot::acquire_program_path(const std::string& progname) 59 61 { 60 char* env_path=getenv("PATH"); 61 if (!env_path) 62 throw GnuplotException("Environment variable PATH is not set"); 63 64 std::list<std::string> paths; 65 tokenizer(env_path,paths); 66 for (std::list<std::string>::const_iterator i=paths.begin(); 67 i!=paths.end(); ++i) { 68 std::string tmp((*i) + '/' + progname); 69 if (!access(tmp.c_str(),X_OK)) { 70 gnuplot_binary_=tmp; 71 break; 72 } 62 std::string tmp = GNUPLOT_PATH; 63 if (tmp=="no") 64 throw GnuplotException("no gnuplot binary available"); 65 if (!access(tmp.c_str(),X_OK)) { 66 gnuplot_binary_=tmp; 73 67 } 74 68 75 69 if (gnuplot_binary_.empty()) 76 throw GnuplotException("Cannot find '" + progname + "' in PATH");70 throw GnuplotException("Cannot find '" + tmp); 77 71 } 78 72 -
branches/replacing_gnuplot/lib/Gnuplot.h
r519 r784 6 6 /* 7 7 Copyright (C) 2006 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2007, 2008 Peter Johansson 8 9 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 11 12 svndigest is free software; you can redistribute it and/or modify it 12 13 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 14 15 (at your option) any later version. 15 16 … … 20 21 21 22 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 */ 26 25 -
branches/replacing_gnuplot/lib/GnuplotFE.cc
r589 r784 4 4 Copyright (C) 2006 Jari Häkkinen 5 5 Copyright (C) 2007 Peter Johansson 6 Copyright (C) 2008 Jari Häkkinen, Peter Johansson 6 7 7 This file is part of svndigest, http:// trac.thep.lu.se/svndigest8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 9 9 10 svndigest is free software; you can redistribute it and/or modify it 10 11 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 12 13 (at your option) any later version. 13 14 … … 18 19 19 20 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 22 */ 24 23 -
branches/replacing_gnuplot/lib/GnuplotFE.h
r589 r784 7 7 Copyright (C) 2006 Jari Häkkinen, Peter Johansson 8 8 Copyright (C) 2007 Peter Johansson 9 Copyright (C) 2008 Jari Häkkinen, Peter Johansson 9 10 10 This file is part of svndigest, http:// trac.thep.lu.se/svndigest11 This file is part of svndigest, http://dev.thep.lu.se/svndigest 11 12 12 13 svndigest is free software; you can redistribute it and/or modify it 13 14 under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2of the License, or15 the Free Software Foundation; either version 3 of the License, or 15 16 (at your option) any later version. 16 17 … … 21 22 22 23 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 25 02111-1307, USA. 24 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 26 25 */ 27 26 -
branches/replacing_gnuplot/lib/HtmlBuf.cc
r606 r784 5 5 Copyright (C) 2008 Peter Johansson 6 6 7 This file is part of svndigest, http:// trac.thep.lu.se/svndigest7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 8 9 9 svndigest is free software; you can redistribute it and/or modify it 10 10 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 12 12 (at your option) any later version. 13 13 … … 18 18 19 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 21 */ 24 22 -
branches/replacing_gnuplot/lib/HtmlBuf.h
r606 r784 7 7 Copyright (C) 2007, 2008 Peter Johansson 8 8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 -
branches/replacing_gnuplot/lib/HtmlStream.cc
r606 r784 3 3 /* 4 4 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2008 Peter Johansson 5 6 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 8 8 9 svndigest is free software; you can redistribute it and/or modify it 9 10 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 11 12 (at your option) any later version. 12 13 … … 17 18 18 19 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 21 */ 23 22 -
branches/replacing_gnuplot/lib/HtmlStream.h
r606 r784 5 5 6 6 /* 7 Copyright (C) 2007 Peter Johansson7 Copyright (C) 2007, 2008 Peter Johansson 8 8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 -
branches/replacing_gnuplot/lib/LineTypeParser.cc
r556 r784 4 4 Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson 5 5 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest6 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 7 8 8 svndigest is free software; you can redistribute it and/or modify it 9 9 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 … … 17 17 18 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 19 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 20 */ 23 21 -
branches/replacing_gnuplot/lib/LineTypeParser.h
r552 r784 8 8 Copyright (C) 2007 Peter Johansson 9 9 10 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 11 11 12 12 svndigest is free software; you can redistribute it and/or modify it 13 13 under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 15 15 (at your option) any later version. 16 16 … … 21 21 22 22 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 25 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 26 24 */ 27 25 -
branches/replacing_gnuplot/lib/Makefile.am
r646 r784 5 5 # Copyright (C) 2005 Jari Häkkinen 6 6 # Copyright (C) 2006 Jari Häkkinen, Peter Johansson 7 # Copyright (C) 2007 2008 Peter Johansson 7 # Copyright (C) 2007, 2008 Peter Johansson 8 # Copyright (C) 2008 Jari Häkkinen, Peter Johansson 9 # Copyright (C) 2009 Peter Johansson 8 10 # 9 # This file is part of svndigest, http:// trac.thep.lu.se/svndigest11 # This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 12 # 11 13 # svndigest is free software; you can redistribute it and/or modify it 12 14 # under the terms of the GNU General Public License as published by 13 # the Free Software Foundation; either version 2of the License, or15 # the Free Software Foundation; either version 3 of the License, or 14 16 # (at your option) any later version. 15 17 # … … 20 22 # 21 23 # You should have received a copy of the GNU General Public License 22 # along with this program; if not, write to the Free Software 23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 # 02111-1307, USA. 24 # along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 25 26 26 AM_CPPFLAGS = $(SVNDIGEST_CPPFLAGS) 27 27 AM_CXXFLAGS = $(SVNDIGEST_CXXFLAGS) 28 28 29 noinst_L TLIBRARIES = libsvndigest.la29 noinst_LIBRARIES = libsvndigest.a 30 30 31 31 noinst_HEADERS = AddStats.h Alias.h BlameStats.h ClassicStats.h ColumnStream.h \ 32 Commitment.h Configuration.h css.h\ 33 Date.h Directory.h File.h first_page.h Functor.h Gnuplot.h GnuplotFE.h \ 32 CommandLine.h Commitment.h Configuration.h copyright_year.h css.h\ 33 Date.h Directory.h Exception.h File.h first_page.h Functor.h \ 34 Gnuplot.h GnuplotFE.h \ 34 35 HtmlBuf.h HtmlStream.h html_utility.h LineTypeParser.h \ 35 Node.h Option.h rmdirhier.h \ 36 Node.h Option.h OptionArg.h OptionHelp.h OptionSwitch.h \ 37 OptionVersion.h rmdirhier.h \ 36 38 Stats.h StatsCollection.h subversion_info.h SVN.h SVNblame.h \ 37 39 SVNinfo.h SVNlog.h SVNproperty.h Trac.h utility.h 38 40 39 libsvndigest_ la_SOURCES = AddStats.cc Alias.cc BlameStats.cc \41 libsvndigest_a_SOURCES = AddStats.cc Alias.cc BlameStats.cc \ 40 42 ClassicStats.cc ColumnStream.cc \ 41 Comm itment.cc Configuration.cc \43 CommandLine.cc Commitment.cc Configuration.cc copyright_year.cc \ 42 44 css.cc Date.cc Directory.cc File.cc first_page.cc\ 43 45 Functor.cc Gnuplot.cc GnuplotFE.cc HtmlBuf.cc HtmlStream.cc \ 44 46 html_utility.cc LineTypeParser.cc Node.cc \ 45 rmdirhier.cc Stats.cc StatsCollection.cc subversion_info.cc SVN.cc \ 47 Option.cc OptionHelp.cc OptionSwitch.cc OptionVersion.cc \ 48 rmdirhier.cc Stats.cc StatsCollection.cc subversion_info.cc SVN.cc \ 46 49 SVNblame.cc SVNinfo.cc SVNlog.cc SVNproperty.cc Trac.cc utility.cc 47 50 … … 55 58 56 59 if HAVE_SVN_WC 57 @srcdir@/subversion_info.cc: subversion_info.cc.tmp58 @$(SHELL) @top_srcdir@/build_support/move-if-change subversion_info.cc.tmp \59 @srcdir@/subversion_info.cc60 $(srcdir)/subversion_info.cc: subversion_info.cc.tmp 61 @$(SHELL) $(top_srcdir)/build_support/move-if-change subversion_info.cc.tmp \ 62 $(srcdir)/subversion_info.cc 60 63 61 64 subversion_info.cc.tmp: FORCE 62 65 @echo '// subversion_info.cc generated from subversion_info.cc.in.' > $@ ;\ 63 66 revision=`$(SVNVERSION) $(top_srcdir)` ;\ 64 year=`svn info $(top_srcdir)|$(SED) -n 's/.*Date: \(.*\)-..-.*/\1/p'`;\ 65 $(SED) -e 's/sub_2_svn_revision/'$$revision'/g' \ 66 -e 's/sub_2_svn_year/'$$year'/g' @srcdir@/subversion_info.cc.in >> $@ ; 67 $(SED) -e 's/sub_2_svn_revision/r'$$revision'/g' \ 68 $(srcdir)/subversion_info.cc.in >> $@ ; 69 70 # update copyright year automatically (if we build from svn wc) 71 $(srcdir)/copyright_year.cc: copyright_year.cc.tmp 72 @$(SHELL) $(top_srcdir)/build_support/move-if-change $< $@ 73 74 copyright_year.cc.tmp: FORCE 75 @year=`svn info $(top_srcdir)|$(SED) -n 's/.*Date: \(.*\)-..-.*/\1/p'`;\ 76 $(SED) -e 's/"20[0-9][0-9]"/'\"$$year\"'/g' $(srcdir)/copyright_year.cc > $@ ; 77 78 else 79 # this is needed in 'svn export' build 80 $(srcdir)/subversion_info.cc: 81 $(SED) -e 's/sub_2_svn_revision//g' \ 82 $(srcdir)/subversion_info.cc.in >> $@ ; 83 67 84 endif 68 85 -
branches/replacing_gnuplot/lib/Node.cc
r646 r784 3 3 /* 4 4 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 5 6 This file is part of svndigest, http://trac.thep.lu.se/svndigest 5 Copyright (C) 2008 Jari Häkkinen 6 Copyright (C) 2009 Peter Johansson 7 8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 9 8 10 svndigest is free software; you can redistribute it and/or modify it 9 11 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 11 13 (at your option) any later version. 12 14 … … 17 19 18 20 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 22 */ 23 23 … … 25 25 26 26 #include "Date.h" 27 #include "HtmlStream.h" 27 28 #include "html_utility.h" 28 29 #include "SVNlog.h" … … 77 78 return svninfo_.last_changed_author(); 78 79 assert(log().commits().size()); 79 return log(). commits().back().author();80 return log().latest_commit().author(); 80 81 } 81 82 … … 144 145 return svninfo_.last_changed_rev(); 145 146 assert(log().commits().size()); 146 return log(). commits().back().revision();147 return log().latest_commit().revision(); 147 148 } 148 149 … … 150 151 const SVNlog& Node::log(void) const 151 152 { 152 if (!log_) 153 if (!log_) { 153 154 if (ignore()) 154 155 log_ = new SVNlog; 155 else 156 log_ = new SVNlog(log_core()); 156 else { 157 log_ = new SVNlog(path()); 158 log_core(*log_); 159 } 160 } 157 161 return *log_; 158 162 } … … 203 207 if (verbose) 204 208 std::cout << "Printing output for " << path_ << std::endl; 205 SVNlog log(path_);209 const SVNlog& log = this->log(); 206 210 typedef std::map<std::string, Stats*>::const_iterator iter; 207 211 … … 229 233 const SVNlog& log) const 230 234 { 235 HtmlStream hs(os); 231 236 os << "<h3>Author Summary</h3>"; 232 237 os << "<table class=\"listings\">\n"; … … 252 257 253 258 // print authors 254 const std::string timefmt("% e/%m/%y %H:%M:%S");259 const std::string timefmt("%Y-%m-%d %H:%M"); 255 260 for (std::set<std::string>::const_iterator i=stats.authors().begin(); 256 261 i!=stats.authors().end(); ++i){ … … 267 272 << "</td><td>" << stats.empty(*i); 268 273 if (log.exist(*i)) { 269 Commitmentlc(log.latest_commit(*i));274 const Commitment& lc(log.latest_commit(*i)); 270 275 os << "</td>" << "<td>" << trac_revision(lc.revision()) 271 << "</td>" << "<td>" << Date(lc.date())(timefmt); 276 << "</td>" << "<td>"; 277 hs << Date(lc.date())(timefmt); 272 278 } 273 279 else { … … 295 301 os << "<td>" << stats.comments() << "</td>\n"; 296 302 os << "<td>" << stats.empty() << "</td>\n"; 297 Commitmentlc(log.latest_commit());303 const Commitment& lc(log.latest_commit()); 298 304 os << "<td>" << trac_revision(lc.revision()) << "</td>\n"; 299 os << "<td>" << Date(lc.date())(timefmt)<< "</td>\n"; 305 os << "<td>"; 306 hs << Date(lc.date())(timefmt); 307 os << "</td>\n"; 300 308 os << "</tr>\n"; 301 309 os << "</tbody>\n"; … … 304 312 305 313 314 void Node::print_copyright(std::map<std::string,Alias>& alias, 315 bool verbose) const 316 { 317 // map with last rev for every year 318 std::map<int, svn_revnum_t> year2rev; 319 SVNlog log(path()); 320 typedef SVNlog::container::const_iterator LogIterator; 321 for (LogIterator i=log.commits().begin(); i!=log.commits().end(); ++i){ 322 time_t sec = str2time(i->date()); 323 tm* timeinfo = gmtime(&sec); 324 year2rev[timeinfo->tm_year] = i->revision(); 325 } 326 print_copyright(alias, verbose, year2rev); 327 } 328 329 306 330 std::string Node::url(void) const 307 331 { -
branches/replacing_gnuplot/lib/Node.h
r589 r784 6 6 /* 7 7 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 8 9 This file is part of svndigest, http://trac.thep.lu.se/svndigest 8 Copyright (C) 2009 Peter Johansson 9 10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 11 12 svndigest is free software; you can redistribute it and/or modify it 12 13 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 14 15 (at your option) any later version. 15 16 … … 20 21 21 22 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 */ 26 25 … … 170 169 const SVNlog&) const; 171 170 172 virtual void print_copyright(std::map<std::string,Alias>&, bool) const=0; 171 /** 172 creates a map from year to last rev for that year and call 173 virtual function. 174 */ 175 void print_copyright(std::map<std::string,Alias>&, bool) const; 176 177 /** 178 typically called from function above 179 */ 180 virtual void print_copyright(std::map<std::string,Alias>&, bool, 181 const std::map<int,svn_revnum_t>&) const=0; 173 182 174 183 /** … … 190 199 191 200 protected: 192 193 virtual SVNlog log_core(void) const=0;194 201 195 202 /// … … 210 217 /// 211 218 Node(const Node&); 219 220 virtual void log_core(SVNlog&) const=0; 212 221 213 222 virtual void print_core(bool verbose=false) const=0; -
branches/replacing_gnuplot/lib/Option.h
r646 r784 5 5 6 6 /* 7 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 7 8 Copyright (C) 2008 Peter Johansson 8 9 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 11 12 svndigest is free software; you can redistribute it and/or modify it 12 13 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 14 15 (at your option) any later version. 15 16 … … 20 21 21 22 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 */ 26 25 26 #include <iostream> 27 27 #include <string> 28 #include <vector> 28 29 29 namespace theplu {30 namespace svndigest {30 namespace theplu { 31 namespace svndigest { 31 32 33 class CommandLine; 32 34 /// 33 /// Class taking care of cmd options in Parameter35 /// @brief Container of variables for an option. @see CommandLine 34 36 /// 35 template<typename T>36 37 class Option 37 38 { 38 39 public: 39 Option(T value): default_(value), value_(value) {} 40 inline const T& default_value(void) const { return default_; } 41 inline void reset(void) { value_=default_; } 42 inline T& value(void) { return value_; } 43 inline const T& value(void) const { return value_; } 40 /** 41 @brief Constructor 42 43 \param cmd Commandline to be hooked up with. 44 @param name string such as "help" for --help, "h" for -h or 45 "h,help" for having both short and long option name 46 @param desc string used in help display 47 */ 48 Option(CommandLine& cmd, std::string name, std::string desc); 49 50 /** 51 @brief destructor 52 */ 53 virtual ~Option(void); 54 55 /** 56 @return description 57 */ 58 std::string description(void) const; 59 60 /** 61 \return long name e.g. 'help' for --help option. 62 */ 63 std::string long_name(void) const; 64 65 /** 66 \brief parsing the commandline 67 */ 68 void parse(std::vector<std::string>::iterator&, 69 const std::vector<std::string>::iterator&); 70 71 /** 72 @brief Get if option was found in cmd. 73 74 @return true if option has been detected in parsing 75 */ 76 bool present(void) const; 77 78 /** 79 \brief print help output 80 81 This function calls the four virtual private functions print1, 82 print2, print3, and print4. This allows an inherited class to 83 implement one (or several) of these functions and keep the 84 default output of the others. The default behavior is that: 85 86 - print1 prints the short name, '-h', as short_name(void) const 87 - print2 prints the long name, '--help', as long_name(void) const 88 - print3 is empty 89 - print4 prints the description as description(void) const. 90 */ 91 std::string print(void); 92 93 /** 94 \brief sets present to false 95 */ 96 void reset(void); 97 98 /** 99 \return short name e.g. 'h' for -h option. 100 */ 101 char short_name(void) const; 102 103 /** 104 \brief Validate the Option 105 106 This function is called after commandline is parsed. 107 */ 108 void validate(void); 109 110 protected: 111 /** 112 \return const reference to CommandLine Option belongs to. 113 */ 114 const CommandLine& cmd(void) const; 44 115 45 116 private: 46 const T default_;47 T value_;117 virtual void do_parse(std::vector<std::string>::iterator&, 118 const std::vector<std::string>::iterator&)=0; 48 119 120 /** 121 */ 122 virtual std::string print1(void) const; 123 124 /** 125 */ 126 virtual std::string print2(void) const; 127 128 /** 129 */ 130 virtual std::string print3(void) const; 131 132 /** 133 */ 134 virtual std::string print4(void) const; 135 136 /** 137 */ 138 virtual void do_validate(void) const=0; 139 140 141 const CommandLine& cmd_; 142 std::string description_; 143 std::string long_name_; 144 bool present_; 145 char short_name_; 146 147 // copy not allowed 148 Option(const Option&); 149 Option& operator=(const Option&); 49 150 }; 50 151 51 }} // end of namespace svndigest end of namespacetheplu152 }} // of namespace svndigest, and theplu 52 153 53 #endif 154 #endif -
branches/replacing_gnuplot/lib/SVN.cc
r646 r784 6 6 Copyright (C) 2008 Peter Johansson 7 7 8 This file is part of svndigest, http:// trac.thep.lu.se/svndigest8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 9 9 10 10 svndigest is free software; you can redistribute it and/or modify it 11 11 under the terms of the GNU General Public License as published by 12 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 13 13 (at your option) any later version. 14 14 … … 19 19 20 20 You should have received a copy of the GNU General Public License 21 along with this program; if not, write to the Free Software 22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 23 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 24 22 */ 25 23 -
branches/replacing_gnuplot/lib/SVN.h
r579 r784 9 9 Copyright (C) 2008 Peter Johansson 10 10 11 This file is part of svndigest, http:// trac.thep.lu.se/svndigest11 This file is part of svndigest, http://dev.thep.lu.se/svndigest 12 12 13 13 svndigest is free software; you can redistribute it and/or modify it 14 14 under the terms of the GNU General Public License as published by 15 the Free Software Foundation; either version 2of the License, or15 the Free Software Foundation; either version 3 of the License, or 16 16 (at your option) any later version. 17 17 … … 22 22 23 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 26 02111-1307, USA. 24 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 27 25 */ 28 26 -
branches/replacing_gnuplot/lib/SVNblame.cc
r535 r784 4 4 Copyright (C) 2006 Jari Häkkinen 5 5 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 6 Copyright (C) 2008 Peter Johansson 6 7 7 This file is part of svndigest, http:// trac.thep.lu.se/svndigest8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 9 9 10 svndigest is free software; you can redistribute it and/or modify it 10 11 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 12 13 (at your option) any later version. 13 14 … … 18 19 19 20 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 22 */ 24 23 -
branches/replacing_gnuplot/lib/SVNblame.h
r535 r784 7 7 Copyright (C) 2006 Jari Häkkinen 8 8 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 9 Copyright (C) 2008 Peter Johansson 9 10 10 This file is part of svndigest, http:// trac.thep.lu.se/svndigest11 This file is part of svndigest, http://dev.thep.lu.se/svndigest 11 12 12 13 svndigest is free software; you can redistribute it and/or modify it 13 14 under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2of the License, or15 the Free Software Foundation; either version 3 of the License, or 15 16 (at your option) any later version. 16 17 … … 21 22 22 23 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 25 02111-1307, USA. 24 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 26 25 */ 27 26 -
branches/replacing_gnuplot/lib/SVNinfo.cc
r519 r784 4 4 Copyright (C) 2006 Jari Häkkinen 5 5 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 6 Copyright (C) 2008 Peter Johansson 6 7 7 This file is part of svndigest, http:// trac.thep.lu.se/svndigest8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 9 9 10 svndigest is free software; you can redistribute it and/or modify it 10 11 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 12 13 (at your option) any later version. 13 14 … … 18 19 19 20 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 22 */ 24 23 -
branches/replacing_gnuplot/lib/SVNinfo.h
r519 r784 7 7 Copyright (C) 2006 Jari Häkkinen 8 8 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 9 Copyright (C) 2008 Peter Johansson 9 10 10 This file is part of svndigest, http:// trac.thep.lu.se/svndigest11 This file is part of svndigest, http://dev.thep.lu.se/svndigest 11 12 12 13 svndigest is free software; you can redistribute it and/or modify it 13 14 under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2of the License, or15 the Free Software Foundation; either version 3 of the License, or 15 16 (at your option) any later version. 16 17 … … 21 22 22 23 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 25 02111-1307, USA. 24 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 26 25 */ 27 26 -
branches/replacing_gnuplot/lib/SVNlog.cc
r646 r784 2 2 3 3 /* 4 Copyright (C) 2007 Jari Häkkinen, Peter Johansson4 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 5 5 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest6 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 7 8 8 svndigest is free software; you can redistribute it and/or modify it 9 9 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 … … 17 17 18 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 19 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 20 */ 23 21 … … 29 27 #include <algorithm> 30 28 #include <cassert> 29 #include <stdexcept> 30 #include <sstream> 31 31 #include <string> 32 #include <vector>33 32 34 33 namespace theplu { … … 56 55 { 57 56 58 std::vector<Commitment>::const_reverse_iterator iter = commits().rbegin();57 SVNlog::container::const_reverse_iterator iter = commits().rbegin(); 59 58 for ( ; iter!= commits().rend(); ++iter) 60 59 if (iter->author() == name) … … 66 65 const Commitment& SVNlog::latest_commit(void) const 67 66 { 68 return commits().back(); 67 assert(commits().size()); 68 return *commits().rbegin(); 69 69 } 70 70 … … 72 72 const Commitment& SVNlog::latest_commit(std::string name) const 73 73 { 74 std::vector<Commitment>::const_reverse_iterator iter = commits().rbegin();74 SVNlog::container::const_reverse_iterator iter = commits().rbegin(); 75 75 for ( ; iter!= commits().rend(); ++iter) 76 76 if (iter->author() == name) 77 77 return *iter; 78 assert(false); 78 std::stringstream ss; 79 ss << __FILE__ << " could not find author: " << name; 80 throw std::runtime_error(ss.str()); 81 // let us return something to avoid compiler warnings 82 return *commits().begin(); 79 83 } 80 84 … … 95 99 if (msg) 96 100 message = msg; 97 lb->commits. push_back(Commitment(a, date, message, rev));101 lb->commits.insert(lb->commits.end(), Commitment(a, date, message, rev)); 98 102 return SVN_NO_ERROR; 99 103 } … … 108 112 SVNlog& operator+=(SVNlog& lhs, const SVNlog& rhs) 109 113 { 110 SVNlog log; 111 std::vector<Commitment>::iterator lhs_iter=lhs.commits().begin(); 112 std::vector<Commitment>::const_iterator rhs_iter=rhs.commits().begin(); 113 while(lhs_iter<lhs.commits().end() && rhs_iter<rhs.commits().end()) { 114 if (lhs_iter->revision() < rhs_iter->revision()) { 115 116 log.commits().push_back(*lhs_iter); 117 ++lhs_iter; 118 } 119 else if (rhs_iter->revision()<lhs_iter->revision()) { 120 log.commits().push_back(*rhs_iter); 121 ++rhs_iter; 122 } 123 else { 124 log.commits().push_back(*lhs_iter); 125 ++lhs_iter; 126 ++rhs_iter; 127 } 128 } 129 while(lhs_iter<lhs.commits().end()) { 130 log.commits().push_back(*lhs_iter); 131 ++lhs_iter; 132 } 133 while(rhs_iter<rhs.commits().end()) { 134 log.commits().push_back(*rhs_iter); 135 ++rhs_iter; 136 } 137 lhs.swap(log); 114 lhs.commits().insert(rhs.commits().begin(), rhs.commits().end()); 138 115 return lhs; 139 116 } -
branches/replacing_gnuplot/lib/SVNlog.h
r646 r784 6 6 /* 7 7 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2008 Peter Johansson 8 9 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 11 12 svndigest is free software; you can redistribute it and/or modify it 12 13 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 14 15 (at your option) any later version. 15 16 … … 20 21 21 22 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 */ 26 25 … … 30 29 31 30 #include <string> 32 #include < vector>31 #include <set> 33 32 34 33 #include <subversion-1/svn_client.h> … … 46 45 class SVNlog { 47 46 public: 47 /** 48 container used to store log 49 */ 50 typedef std::set<Commitment, LessRevision> container; 51 48 52 /** 49 53 Default constructor. Creates empty log. … … 67 71 \return Commitments 68 72 */ 69 inline const std::vector<Commitment>& commits(void) const73 inline const container& commits(void) const 70 74 { return lb_.commits; } 71 75 … … 73 77 \return Commitments 74 78 */ 75 inline std::vector<Commitment>& commits(void)79 inline container& commits(void) 76 80 { return lb_.commits; } 77 81 … … 112 116 */ 113 117 struct log_receiver_baton { 114 std::vector<Commitment>commits;118 container commits; 115 119 } lb_; 116 120 -
branches/replacing_gnuplot/lib/SVNproperty.cc
r519 r784 3 3 /* 4 4 Copyright (C) 2006 Jari Häkkinen 5 Copyright (C) 2007, 2008 Peter Johansson 5 6 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 8 8 9 svndigest is free software; you can redistribute it and/or modify it 9 10 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 11 12 (at your option) any later version. 12 13 … … 17 18 18 19 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 21 */ 23 22 -
branches/replacing_gnuplot/lib/SVNproperty.h
r519 r784 6 6 /* 7 7 Copyright (C) 2006 Jari Häkkinen 8 Copyright (C) 2007, 2008 Peter Johansson 8 9 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest10 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 11 11 12 svndigest is free software; you can redistribute it and/or modify it 12 13 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or14 the Free Software Foundation; either version 3 of the License, or 14 15 (at your option) any later version. 15 16 … … 20 21 21 22 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 23 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 24 */ 26 25 -
branches/replacing_gnuplot/lib/Stats.cc
r646 r784 4 4 Copyright (C) 2005 Peter Johansson 5 5 Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson 6 7 This file is part of svndigest, http://trac.thep.lu.se/svndigest 6 Copyright (C) 2008 Peter Johansson 7 8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 9 9 10 svndigest is free software; you can redistribute it and/or modify it 10 11 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 12 13 (at your option) any later version. 13 14 … … 18 19 19 20 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 22 */ 24 23 … … 66 65 67 66 68 void Stats::accumulate(std::vector<unsigned int>& vec) const 69 { 67 void Stats::accumulate(std::vector<unsigned int>& vec, 68 svn_revnum_t rev) const 69 { 70 assert(rev>0); 70 71 if (vec.empty()){ 71 72 // just to allow call to vec.back() below 72 73 vec.resize(1,0); 73 74 } 74 else 75 std::partial_sum(vec.begin() ,vec.end(),vec.begin());75 else if (vec.begin()+rev-1 < vec.end()) 76 std::partial_sum(vec.begin()+rev-1,vec.end(),vec.begin()+rev-1); 76 77 // static_cast to remove annoying compiler warning 77 78 if (vec.size() < static_cast<size_t>(revision()+1)) … … 80 81 81 82 82 void Stats::accumulate_stats(void) 83 { 83 void Stats::accumulate_stats(svn_revnum_t rev) 84 { 85 if (!rev) 86 rev = 1; 84 87 for (std::set<std::string>::const_iterator iter(authors().begin()); 85 88 iter!=authors().end(); ++iter) { 86 89 std::vector<unsigned int>& code = code_stats()[*iter]; 87 accumulate(code );90 accumulate(code, rev); 88 91 std::vector<unsigned int>& comments = comment_stats()[*iter]; 89 accumulate(comments );92 accumulate(comments, rev); 90 93 std::vector<unsigned int>& other = other_stats()[*iter]; 91 accumulate(other );94 accumulate(other, rev); 92 95 std::vector<unsigned int>& copyright = copyright_stats()[*iter]; 93 accumulate(copyright );96 accumulate(copyright, rev); 94 97 } 95 98 } … … 266 269 ss >> rev; 267 270 ss >> count; 271 assert(rev<=revision_); 268 272 if (!count) 269 273 break; 270 if (rev+1 < static_cast<svn_revnum_t>(vec.size()) ) 271 vec.resize(rev+1); 274 vec.resize(std::max(vec.size(),static_cast<size_t>(rev+1))); 272 275 vec[rev]=count; 273 276 } … … 277 280 278 281 279 boolStats::load_cache(std::istream& is)282 svn_revnum_t Stats::load_cache(std::istream& is) 280 283 { 281 284 std::string str; 282 285 getline(is, str); 283 286 if (str!=cache_check_str()) 284 return false;287 return 0; 285 288 svn_revnum_t rev; 286 289 is >> rev; 287 if (rev<last_changed_rev()){288 return false; // cache is not up to date289 }290 290 reset(); 291 291 size_t a_size=0; … … 297 297 } 298 298 getline(is, str); 299 if (str!=cache_check_str()) 300 return false; 299 if (str!=cache_check_str()) { 300 return 0; 301 } 301 302 for (size_t i=0; i<stats_.size(); ++i){ 302 303 load(is, stats_[i]); 303 304 getline(is, str); 304 if (str!=cache_check_str()) 305 return false; 306 } 307 return true; 305 if (str!=cache_check_str()) { 306 return 0; 307 } 308 } 309 return rev; 308 310 } 309 311 … … 335 337 336 338 337 void Stats::parse(const std::string& path )338 { 339 do_parse(path );339 void Stats::parse(const std::string& path, svn_revnum_t rev) 340 { 341 do_parse(path, rev); 340 342 calc_comment_or_copy(); 341 343 calc_total(); … … 510 512 for (size_t i=0; i<stats_.size(); ++i){ 511 513 stats_[i].clear(); 512 stats_[i]["all"]=std::vector<unsigned int>(revision_+1); 514 std::vector<unsigned int>& tmp = stats_[i]["all"]; 515 std::fill(tmp.begin(), tmp.end(), 0); 516 tmp.resize(revision_+1); 513 517 } 514 518 authors_.clear(); -
branches/replacing_gnuplot/lib/Stats.h
r646 r784 7 7 Copyright (C) 2005 Peter Johansson 8 8 Copyright (C) 2006 Jari Häkkinen, Peter Johansson 9 Copyright (C) 2007 Peter Johansson10 11 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 Copyright (C) 2007, 2008 Peter Johansson 10 11 This file is part of svndigest, http://dev.thep.lu.se/svndigest 12 12 13 13 svndigest is free software; you can redistribute it and/or modify it 14 14 under the terms of the GNU General Public License as published by 15 the Free Software Foundation; either version 2of the License, or15 the Free Software Foundation; either version 3 of the License, or 16 16 (at your option) any later version. 17 17 … … 22 22 23 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 26 02111-1307, USA. 24 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 27 25 */ 28 26 … … 68 66 69 67 /// 70 /// 68 /// \return number of code lines for \a user for latest revision. 71 69 /// 72 70 unsigned int code(const std::string& user="all") const; … … 74 72 75 73 /// 76 /// 74 /// \return number of comments lines for \a user for latest revision. 77 75 /// 78 76 unsigned int comments(const std::string& user="all") const; 79 77 80 78 /// 81 /// 79 /// \return number of empty lines for \a user for latest revision. 82 80 /// 83 81 unsigned int empty(const std::string& user="all") const; 84 82 85 83 /// 86 /// 84 /// \return revison node was modified 87 85 /// 88 86 svn_revnum_t last_changed_rev(void) const; 89 87 90 88 /// 91 /// 89 /// \return number of lines for \a user for latest revision 92 90 /// 93 91 unsigned int lines(const std::string& user="all") const; … … 96 94 Load object from a stream. 97 95 98 \return true if successful99 */ 100 boolload_cache(std::istream&);101 102 /** 103 Do the parsing 96 \return revision the cache represents - 0 if failed 97 */ 98 svn_revnum_t load_cache(std::istream&); 99 100 /** 101 Do the parsing for \a path. Revisions from \a rev will be parsed. 104 102 */ 105 void parse(const std::string& );103 void parse(const std::string& path, svn_revnum_t rev=0); 106 104 107 105 /// … … 149 147 typedef Author2Vector::const_iterator A2VConstIter; 150 148 151 void accumulate_stats(void); 149 /** 150 Calculate accumalated statistics for fundamental statistics, 151 i.e., code, comment, empty, and copyright for each author. 152 \see accumulate 153 */ 154 void accumulate_stats(svn_revnum_t rev=1); 152 155 void add_author(std::string); 153 156 void add_authors(std::set<std::string>::const_iterator, … … 199 202 std::string user) const; 200 203 private: 201 void accumulate(std::vector<unsigned int>& vec) const; 204 /** 205 \a vec is resized to revision(). 206 vec is accumulated such that 207 vec[rev] = vec[rev-1] + vec[rev] 208 vec[rev+1] = vec[rev] + vec[rev+1] 209 et cetera 210 */ 211 void accumulate(std::vector<unsigned int>& vec, 212 svn_revnum_t rev=1) const; 202 213 void add(std::vector<unsigned int>& vec, unsigned int rev, bool x, 203 214 unsigned int n); 204 215 205 virtual void do_parse(const std::string&)=0; 216 /** 217 Parse statistics for fundamental categories, i.e., code, 218 comment, empty, and copyright for each author. Ignore revisions 219 earlier than \a first_rev. 220 */ 221 virtual void do_parse(const std::string&, svn_revnum_t first_rev)=0; 206 222 207 223 // Change this string if cache format is changed in such a way 208 224 // that all old cache files are obsolete. 209 225 inline std::string cache_check_str(void) const 210 {return "CACHE FILE VERSION 5";}226 {return "CACHE FILE VERSION 6";} 211 227 212 228 void calc_all(void); -
branches/replacing_gnuplot/lib/StatsCollection.cc
r543 r784 4 4 Copyright (C) 2007 Peter Johansson 5 5 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest6 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 7 8 8 svndigest is free software; you can redistribute it and/or modify it 9 9 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 … … 17 17 18 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 19 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 20 */ 23 21 … … 63 61 bool result = true; 64 62 for (map::const_iterator i(stats_.begin()); i!=stats_.end(); ++i) { 65 if(!i->second->load_cache(is)){ 63 svn_revnum_t cache_rev = i->second->load_cache(is); 64 if (cache_rev < i->second->last_changed_rev()) { 65 cache_rev=0; // tmp hack to avoid partial cache 66 66 result = false; 67 i->second->reset(); 68 i->second->parse(path_); 67 // reset if load cache failed 68 if (!cache_rev) 69 i->second->reset(); 70 i->second->parse(path_, cache_rev+1); 69 71 } 70 72 } -
branches/replacing_gnuplot/lib/StatsCollection.h
r538 r784 9 9 Copyright (C) 2007 Peter Johansson 10 10 11 This file is part of svndigest, http:// trac.thep.lu.se/svndigest11 This file is part of svndigest, http://dev.thep.lu.se/svndigest 12 12 13 13 svndigest is free software; you can redistribute it and/or modify it 14 14 under the terms of the GNU General Public License as published by 15 the Free Software Foundation; either version 2of the License, or15 the Free Software Foundation; either version 3 of the License, or 16 16 (at your option) any later version. 17 17 … … 22 22 23 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 26 02111-1307, USA. 24 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 27 25 */ 28 26 -
branches/replacing_gnuplot/lib/Trac.cc
r519 r784 3 3 /* 4 4 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 5 6 This file is part of svndigest, http://trac.thep.lu.se/svndigest 5 Copyright (C) 2008, 2009 Peter Johansson 6 7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 8 8 9 svndigest is free software; you can redistribute it and/or modify it 9 10 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 11 12 (at your option) any later version. 12 13 … … 17 18 18 19 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 21 */ 23 22 … … 50 49 51 50 52 bool Trac::changeset(std::string::const_iterator& first, 51 bool Trac::changeset(const std::string::const_iterator& first, 52 std::string::const_iterator& iter, 53 53 const std::string::const_iterator& last, 54 54 const std::string::const_iterator& last_trunc) 55 55 { 56 if (changeset1(first, last, last_trunc))57 return true; 58 if (changeset2( first, last, last_trunc))59 return true; 60 if (changeset3( first, last, last_trunc))56 if (changeset1(first, iter, last, last_trunc)) 57 return true; 58 if (changeset2(iter, last, last_trunc)) 59 return true; 60 if (changeset3(iter, last, last_trunc)) 61 61 return true; 62 62 return false; … … 64 64 65 65 66 bool Trac::changeset1(std::string::const_iterator& first, 66 bool Trac::changeset1(const std::string::const_iterator& first, 67 std::string::const_iterator& iter, 67 68 const std::string::const_iterator& last, 68 69 const std::string::const_iterator& last_trunc) 69 70 { 70 if (first==last) 71 return false; 72 if (*first != 'r') 73 return false; 74 const std::string::const_iterator first_orig(first); 75 ++first; 76 std::string rev = match(first, last, Digit()); 77 if (rev.empty()){ 78 first = first_orig; 71 if (iter==last) 72 return false; 73 if (*iter != 'r') 74 return false; 75 if (iter!=first && isalnum(*(iter-1))) 76 return false; 77 const std::string::const_iterator iter_orig(iter); 78 ++iter; 79 std::string rev = match(iter, last, Digit()); 80 if (rev.empty() || (iter!=last && (std::isalnum(*iter) || *iter==':')) ){ 81 iter = iter_orig; 79 82 return false; 80 83 } 81 84 std::string href(Configuration::instance().trac_root()+"changeset/"+rev); 82 hs_.stream() << anchor(href, anchor_text( first_orig, first, last_trunc));85 hs_.stream() << anchor(href, anchor_text(iter_orig, iter, last_trunc)); 83 86 return true; 84 87 } … … 290 293 291 294 292 bool Trac::log(std::string::const_iterator& first, 295 bool Trac::log(const std::string::const_iterator& first, 296 std::string::const_iterator& iter, 293 297 const std::string::const_iterator& last, 294 298 const std::string::const_iterator& last_trunc) 295 299 { 296 if (log1(first, last, last_trunc))297 return true; 298 if (log2( first, last, last_trunc))299 return true; 300 if (log3( first, last, last_trunc))300 if (log1(first, iter, last, last_trunc)) 301 return true; 302 if (log2(iter, last, last_trunc)) 303 return true; 304 if (log3(iter, last, last_trunc)) 301 305 return true; 302 306 return false; … … 304 308 305 309 306 bool Trac::log1(std::string::const_iterator& first, 310 bool Trac::log1(const std::string::const_iterator& first, 311 std::string::const_iterator& iter, 307 312 const std::string::const_iterator& last, 308 313 const std::string::const_iterator& last_trunc) 309 314 { 310 if (first==last) 311 return false; 312 313 const std::string::const_iterator first_orig(first); 314 if (*first != 'r') 315 return false; 316 ++first; 317 318 std::string stop_rev = match(first, last, AlNum()); 319 if (stop_rev.empty() || first == last || *first != ':') { 320 first = first_orig; 321 return false; 322 } 323 ++first; 324 std::string rev = match(first, last, AlNum()); 325 if (rev.empty() ) { 326 first = first_orig; 315 if (iter==last) 316 return false; 317 318 const std::string::const_iterator iter_orig(iter); 319 if (*iter != 'r') 320 return false; 321 if (iter!=first && isalnum(*(iter-1))) 322 return false; 323 ++iter; 324 325 std::string stop_rev = match(iter, last, Digit()); 326 if (stop_rev.empty() || iter == last || *iter != ':') { 327 iter = iter_orig; 328 return false; 329 } 330 ++iter; 331 std::string rev = match(iter, last, Digit()); 332 if (rev.empty() || (iter!=last && std::isalnum(*iter) ) ){ 333 iter = iter_orig; 327 334 return false; 328 335 } 329 336 std::string href(Configuration::instance().trac_root()+"log/?rev="+ 330 337 rev+"&stop_rev="+stop_rev); 331 hs_.stream() << anchor(href, anchor_text( first_orig,first, last_trunc));338 hs_.stream() << anchor(href, anchor_text(iter_orig,iter, last_trunc)); 332 339 return true; 333 340 } … … 447 454 last_trunc = first+width; 448 455 while (first<last_trunc) { 449 if (log( first, str.end(), last_trunc))456 if (log(str.begin(), first, str.end(), last_trunc)) 450 457 continue; 451 458 if (comment(first, str.end(), last_trunc)) … … 453 460 if (ticket(first, str.end(), last_trunc)) 454 461 continue; 455 if (changeset( first, str.end(), last_trunc))462 if (changeset(str.begin(), first, str.end(), last_trunc)) 456 463 continue; 457 464 if (diff(first, str.end(), last_trunc)) -
branches/replacing_gnuplot/lib/Trac.h
r519 r784 5 5 6 6 /* 7 Copyright (C) 2007 Peter Johansson8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest7 Copyright (C) 2007, 2008, 2009 Peter Johansson 8 9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 … … 60 58 /// @return true if any of changesetX returns true 61 59 /// 62 bool changeset(std::string::const_iterator& first, 60 bool changeset(const std::string::const_iterator& first, 61 std::string::const_iterator& iter, 63 62 const std::string::const_iterator& last, 64 63 const std::string::const_iterator& last_trunc); … … 68 67 /// 69 68 /// Search in range [\a first, \a last) for expression 70 /// /r(\d+)/. If expression is found an anchor to 71 /// trac-root/changeset/123, displaying expression, and first is 72 /// pointing to character after expression. 73 /// 74 /// @return true if expression is found 75 /// 76 bool changeset1(std::string::const_iterator& first, 69 /// /r(\d+)/. In addition character before cannot be 70 /// alpha-numeric, and character after expression cannot be 71 /// alpha-numeric or ':' (beginning/end of string is allowed). If 72 /// expression is found an anchor to trac-root/changeset/123, 73 /// displaying expression, and first is pointing to character 74 /// after expression. 75 /// 76 /// @return true if expression is found 77 /// 78 bool changeset1(const std::string::const_iterator& first, 79 std::string::const_iterator& iter, 77 80 const std::string::const_iterator& last, 78 81 const std::string::const_iterator& last_trunc); … … 189 192 /// @return true if any of logX returns true 190 193 /// 191 bool log(std::string::const_iterator& first, 194 bool log(const std::string::const_iterator& first, 195 std::string::const_iterator& iter, 192 196 const std::string::const_iterator& last, 193 197 const std::string::const_iterator& last_trunc); … … 197 201 /// 198 202 /// Search in range [\a first, \a last) for expression 199 /// /r(\w+):(\w+)/. If expression is found an 200 /// anchor is created, displaying the expression, and first is 201 /// pointing to character after expression. 203 /// /r(\d+):(\d+)/. In addition character before and after 204 /// expression cannot be alpha-numeric (beginning/end of string is 205 /// allowed). If expression is found an anchor is created, 206 /// displaying the expression, and iter is pointing to character 207 /// after expression. 202 208 /// 203 209 /// The created anchor goes to trac-root/log/?rev=236&stop_rev=123 … … 205 211 /// @return true if expression is found 206 212 /// 207 bool log1(std::string::const_iterator& first, 213 bool log1(const std::string::const_iterator& first, 214 std::string::const_iterator& iter, 208 215 const std::string::const_iterator& last, 209 216 const std::string::const_iterator& last_trunc); -
branches/replacing_gnuplot/lib/css.cc
r519 r784 4 4 Copyright (C) 2006 Peter Johansson 5 5 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 6 7 This file is part of svndigest, http://trac.thep.lu.se/svndigest 6 Copyright (C) 2009 Peter Johansson 7 8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 9 9 10 svndigest is free software; you can redistribute it and/or modify it 10 11 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 12 13 (at your option) any later version. 13 14 … … 18 19 19 20 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 22 */ 24 23 … … 38 37 39 38 << "Copyright (C) 2006 Peter Johansson\n" 40 << "Copyright (C) 2007 Jari Häkkinen, Peter Johansson\n\n" 41 << "This file is part of svndigest, " 42 << "http://trac.thep.lu.se/svndigest\n\n" 39 << "Copyright (C) 2007 Jari Häkkinen, Peter Johansson\n" 40 << "Copyright (C) 2009 Peter Johansson\n" 41 << "\nThis file is part of svndigest, " 42 << "http://dev.thep.lu.se/svndigest\n\n" 43 43 44 44 << "svndigest is free software; you can redistribute it and/or " 45 45 << "modify it\n" 46 46 << "under the terms of the GNU General Public License as published by\n" 47 << "the Free Software Foundation; either version 2of the License, or\n"47 << "the Free Software Foundation; either version 3 of the License, or\n" 48 48 << "(at your option) any later version.\n\n" 49 49 … … 54 54 55 55 << "You should have received a copy of the GNU General Public License\n" 56 << "along with this program; if not, write to the Free Software\n" 57 << "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n" 58 << "02111-1307, USA.\n\n" 59 60 << "This file was initially inspired by the cascading style sheet\n" 56 << "along with svndigest. If not, see <http://www.gnu.org/licenses/>.\n" 57 58 << "\n\nThis file was initially inspired by the cascading style sheet\n" 61 59 << "within the Trac open source project (http://trac.edgewall.org/)\n" 62 60 << "Copyright (C) 2003-2006 Edgewall Software\n" -
branches/replacing_gnuplot/lib/css.h
r519 r784 5 5 6 6 /* 7 Copyright (C) 2006, 2007 Peter Johansson7 Copyright (C) 2006, 2007, 2008 Peter Johansson 8 8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 -
branches/replacing_gnuplot/lib/first_page.cc
r646 r784 4 4 Copyright (C) 2006 Peter Johansson 5 5 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 6 7 This file is part of svndigest, http://trac.thep.lu.se/svndigest 6 Copyright (C) 2009 Peter Johansson 7 8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 9 9 10 svndigest is free software; you can redistribute it and/or modify it 10 11 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 12 13 (at your option) any later version. 13 14 … … 18 19 19 20 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 22 */ 24 23 … … 60 59 set<string> authors; 61 60 std::transform(log.commits().begin(), log.commits().end(), 62 std::inserter(authors, authors.begin()), GetAuthor()); 61 std::inserter(authors, authors.begin()), 62 std::mem_fun_ref(&Commitment::author)); 63 63 // erase invalid authors 64 64 authors.erase(""); … … 84 84 { 85 85 assert(log.commits().size()); 86 Date begin(log.commits() [0].date());87 Date end(log. commits().back().date());88 std::string timefmt("%a , %e %b %Y %H:%M:%S");86 Date begin(log.commits().begin()->date()); 87 Date end(log.latest_commit().date()); 88 std::string timefmt("%a %b %e %H:%M:%S %Y"); 89 89 90 90 os << "<div class=\"main\">" … … 102 102 os << end.difftime(begin); 103 103 os << "</td></tr>\n" 104 << "<tr><td>Smallest Revision:</td><td>" << log.commits()[0].revision() 105 << "</td></tr>\n" 106 << "<tr><td>Largest Revision:</td><td>" <<log.commits().back().revision() 104 << "<tr><td>Smallest Revision:</td><td>" 105 << log.commits().begin()->revision() 106 << "</td></tr>\n" 107 << "<tr><td>Largest Revision:</td><td>" << log.latest_commit().revision() 107 108 << "</td></tr>\n" 108 109 << "<tr><td>Revision Count:</td><td>" << log.commits().size() … … 119 120 const Stats& stats) 120 121 { 122 HtmlStream hs(os); 121 123 os << "<div class=\"main\">" 122 124 << "<table class=\"main\"><thead><tr><th colspan=\"2\">" … … 131 133 <<"</tr>"; 132 134 133 std::string timefmt("%Y %b %d %H:%M:%S");135 std::string timefmt("%Y-%m-%d %H:%M"); 134 136 using namespace std; 135 137 for (vector<Commitment>::const_iterator i=lc.begin(); i!=lc.end(); ++i) { … … 146 148 << "%)</td><td>" << stats.comments(i->author()) << " (" 147 149 << 100*stats.comments(i->author())/(stats.comments()?stats.comments():1) 148 << "%)</td><td>" << Date(i->date())(timefmt) << "</td>" <<"</tr>"; 150 << "%)</td><td>"; 151 hs << Date(i->date())(timefmt); 152 os << "</td>" <<"</tr>"; 149 153 } 150 154 os << "<tr><td>Total</td>"; … … 169 173 << "<td>Removed</td><td>Message</td></tr>\n"; 170 174 HtmlStream hs(os); 171 std::string timefmt("%Y %b %d %H:%M:%S");175 std::string timefmt("%Y-%m-%d %H:%M"); 172 176 const size_t maxlength = 80; 173 177 const Configuration& conf = Configuration::instance(); 174 typedef std::vector<Commitment>::const_reverse_iterator iter; 178 typedef SVNlog::container::const_reverse_iterator iter; 179 size_t count = 0; 175 180 for (iter i=log.commits().rbegin(); 176 i < std::min(i+10,log.commits().rend()); ++i) {181 i != log.commits().rend() && count<10; ++i) { 177 182 os << "<tr><td>" 178 183 << anchor(std::string("classic/")+i->author()+"/total/index.html", … … 180 185 << "</td>"; 181 186 Date date(i->date()); 182 os << "<td>" << date(timefmt) << "</td>"; 187 os << "<td>"; 188 hs << date(timefmt); 189 os << "</td>"; 183 190 os << "<td>"; 184 191 os << trac_revision(i->revision()); … … 211 218 212 219 os << "</td></tr>\n"; 220 ++count; 213 221 } 214 222 os << "</table></div>\n"; -
branches/replacing_gnuplot/lib/first_page.h
r556 r784 5 5 6 6 /* 7 Copyright (C) 2006, 2007 Peter Johansson7 Copyright (C) 2006, 2007, 2008 Peter Johansson 8 8 9 This file is part of svndigest, http:// trac.thep.lu.se/svndigest9 This file is part of svndigest, http://dev.thep.lu.se/svndigest 10 10 11 11 svndigest is free software; you can redistribute it and/or modify it 12 12 under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 2of the License, or13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 … … 20 20 21 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 24 02111-1307, USA. 22 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 25 23 */ 26 24 -
branches/replacing_gnuplot/lib/html_utility.cc
r646 r784 4 4 Copyright (C) 2006 Peter Johansson 5 5 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 6 7 This file is part of svndigest, http://trac.thep.lu.se/svndigest 6 Copyright (C) 2009 Peter Johansson 7 8 This file is part of svndigest, http://dev.thep.lu.se/svndigest 8 9 9 10 svndigest is free software; you can redistribute it and/or modify it 10 11 under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2of the License, or12 the Free Software Foundation; either version 3 of the License, or 12 13 (at your option) any later version. 13 14 … … 18 19 19 20 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 22 02111-1307, USA. 21 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 23 22 */ 24 23 24 #include <config.h> 25 25 26 #include "html_utility.h" 26 27 27 #include "config.h"28 28 #include "Configuration.h" 29 29 #include "Date.h" 30 30 #include "HtmlStream.h" 31 31 #include "subversion_info.h" 32 #include <config.h> // this header file is created by configure33 32 34 33 #include <sstream> … … 65 64 { 66 65 Date date; 67 os << "<p class=\"footer\">\nGenerated on " 68 << date("%a %b %d %H:%M:%S %Y") << " (UTC) by " 69 << anchor("http://trac.thep.lu.se/svndigest/", 66 HtmlStream hs(os); 67 os << "<p class=\"footer\">\nGenerated on "; 68 hs << date("%a %b %e %H:%M:%S %Y") << " (UTC) by "; 69 os << anchor("http://dev.thep.lu.se/svndigest/", 70 70 PACKAGE_STRING, 0, ""); 71 71 if (DEV_BUILD) 72 os << " (dev build r" << svn_revision() << ")";72 os << " (dev build " << svn_revision() << ")"; 73 73 os << "\n</p>\n</div>\n</body>\n</html>\n"; 74 74 } … … 78 78 std::string user, std::string item, std::string path, 79 79 const std::string& stats) 80 { 81 print_html_start(os, title, level); 82 os << "<div id=\"menu\">" 83 << "<ul>\n<li></li>\n"; 84 if (item=="main") 85 os << "<li class=\"highlight\">"; 86 else 87 os << "<li>"; 88 os << anchor("index.html", "Main", level, "Main page"); 89 os << "</li>\n"; 90 91 std::string stats_local(stats); 92 if (stats_local=="none") 93 stats_local = "classic"; 94 95 if (item=="total") 96 os << "<li class=\"highlight\">"; 97 else 98 os << "<li>\n"; 99 os << anchor(stats_local+"/"+user+"/total/"+path, "Total", level, 100 "View statistics of all lines"); 101 os << "</li>\n"; 102 103 if (item=="code") 104 os << "<li class=\"highlight\">"; 105 else 106 os << "<li>"; 107 os << anchor(stats_local+"/"+user+"/code/"+path, "Code", level, 108 "View statistics of code lines"); 109 os << "</li>\n"; 110 111 if (item=="comments") 112 os << "<li class=\"highlight\">"; 113 else 114 os << "<li>"; 115 os << anchor(stats_local+"/"+user+"/comments/"+path, "Comment", level, 116 "View statistics of comment lines"); 117 os << "</li>\n"; 118 119 120 if (item=="empty") 121 os << "<li class=\"highlight\">"; 122 else 123 os << "<li>"; 124 os << anchor(stats_local+"/"+user+"/empty/"+path, "Other", level, 125 "View statistics of other lines"); 126 os << "</li>\n"; 127 os << "<li>"; 128 // Peter, this is ugly! But how to add space? 129 for (size_t i=0; i<50; ++i) 130 os << " "; 131 os << "</li>\n"; 132 133 std::string item_local(item); 134 if (item_local=="none") 135 item_local = "total"; 136 if (item_local=="main") 137 item_local = "total"; 138 139 if (stats=="classic") 140 os << "<li class=\"highlight\">"; 141 else 142 os << "<li>"; 143 os << anchor("classic/"+user+"/"+item_local+"/"+path, "Classic", level, 144 "View classic statistics"); 145 os << "</li>\n"; 146 147 if (stats=="blame") 148 os << "<li class=\"highlight\">"; 149 else 150 os << "<li>"; 151 os << anchor("blame/"+user+"/"+item_local+"/"+path, "Blame", level, 152 "View blame statistics"); 153 os << "</li>\n"; 154 155 if (stats=="add") 156 os << "<li class=\"highlight\">"; 157 else 158 os << "<li>"; 159 os << anchor("add/"+user+"/"+item_local+"/"+path, "Add", level, 160 "View add statistics"); 161 os << "</li>\n"; 162 163 164 os << "</li>\n" 165 << "</ul></div>\n" 166 << "<div id=\"main\">\n"; 167 } 168 169 170 void print_html_start(std::ostream& os, const std::string& title, 171 unsigned int level) 80 172 { 81 173 os << "<!-- Generated by " << PACKAGE_STRING << "-->\n"; … … 93 185 os << "svndigest.css\" type=\"text/css\" />\n" 94 186 << "</head>\n" 95 << "<body>\n" 96 << "<div id=\"menu\">" 97 << "<ul>\n<li></li>\n"; 98 if (item=="main") 99 os << "<li class=\"highlight\">"; 100 else 101 os << "<li>"; 102 os << anchor("index.html", "Main", level, "Main page"); 103 os << "</li>\n"; 104 105 std::string stats_local(stats); 106 if (stats_local=="none") 107 stats_local = "classic"; 108 109 if (item=="total") 110 os << "<li class=\"highlight\">"; 111 else 112 os << "<li>\n"; 113 os << anchor(stats_local+"/"+user+"/total/"+path, "Total", level, 114 "View statistics of all lines"); 115 os << "</li>\n"; 116 117 if (item=="code") 118 os << "<li class=\"highlight\">"; 119 else 120 os << "<li>"; 121 os << anchor(stats_local+"/"+user+"/code/"+path, "Code", level, 122 "View statistics of code lines"); 123 os << "</li>\n"; 124 125 if (item=="comments") 126 os << "<li class=\"highlight\">"; 127 else 128 os << "<li>"; 129 os << anchor(stats_local+"/"+user+"/comments/"+path, "Comment", level, 130 "View statistics of comment lines"); 131 os << "</li>\n"; 132 133 134 if (item=="empty") 135 os << "<li class=\"highlight\">"; 136 else 137 os << "<li>"; 138 os << anchor(stats_local+"/"+user+"/empty/"+path, "Other", level, 139 "View statistics of other lines"); 140 os << "</li>\n"; 141 os << "<li>"; 142 // Peter, this is ugly! But how to add space? 143 for (size_t i=0; i<50; ++i) 144 os << " "; 145 os << "</li>\n"; 146 147 std::string item_local(item); 148 if (item_local=="none") 149 item_local = "total"; 150 if (item_local=="main") 151 item_local = "total"; 152 153 if (stats=="classic") 154 os << "<li class=\"highlight\">"; 155 else 156 os << "<li>"; 157 os << anchor("classic/"+user+"/"+item_local+"/"+path, "Classic", level, 158 "View classic statistics"); 159 os << "</li>\n"; 160 161 if (stats=="blame") 162 os << "<li class=\"highlight\">"; 163 else 164 os << "<li>"; 165 os << anchor("blame/"+user+"/"+item_local+"/"+path, "Blame", level, 166 "View blame statistics"); 167 os << "</li>\n"; 168 169 if (stats=="add") 170 os << "<li class=\"highlight\">"; 171 else 172 os << "<li>"; 173 os << anchor("add/"+user+"/"+item_local+"/"+path, "Add", level, 174 "View add statistics"); 175 os << "</li>\n"; 176 177 178 os << "</li>\n" 179 << "</ul></div>\n" 180 << "<div id=\"main\">\n"; 181 } 182 187 << "<body>\n"; 188 } 183 189 184 190 std::string trac_revision(svn_revnum_t r, std::string color) -
branches/replacing_gnuplot/lib/html_utility.h
r646 r784 6 6 /* 7 7 Copyright (C) 2006 Peter Johansson 8 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 9 Copyright (C) 2008 Peter Johansson 9 10 10 This file is part of svndigest, http:// trac.thep.lu.se/svndigest11 This file is part of svndigest, http://dev.thep.lu.se/svndigest 11 12 12 13 svndigest is free software; you can redistribute it and/or modify it 13 14 under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2of the License, or15 the Free Software Foundation; either version 3 of the License, or 15 16 (at your option) any later version. 16 17 … … 21 22 22 23 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 25 02111-1307, USA. 24 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 26 25 */ 27 26 … … 69 68 70 69 70 /** 71 \brief print html start 72 73 Just like print_header, this function outputs start of html page, 74 but in contrast to print_header there are no menus in the otput 75 of this function. 76 */ 77 void print_html_start(std::ostream& os, const std::string& title, 78 unsigned int level); 79 80 71 81 /// 72 82 /// @return if trac-revision is set in config file anchor to trac is -
branches/replacing_gnuplot/lib/rmdirhier.cc
r519 r784 2 2 3 3 /* 4 Copyright (C) 2006 Jari Häkkinen, Peter Johansson 4 Copyright (C) 2006 Jari Häkkinen 5 Copyright (C) 2007, 2008 Peter Johansson 5 6 6 This file is part of svndigest, http:// trac.thep.lu.se/svndigest7 This file is part of svndigest, http://dev.thep.lu.se/svndigest 7 8 8 9 svndigest is free software; you can redistribute it and/or modify it 9 10 under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2of the License, or11 the Free Software Foundation; either version 3 of the License, or 11 12 (at your option) any later version. 12 13 … … 17 18 18 19 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 02111-1307, USA. 20 along with svndigest. If not, see <http://www.gnu.org/licenses/>. 22 21 */ 23 22 … … 64 63 void rmdirhier__(const std::string& dir) 65 64 { 65 struct stat buf; 66 // using lstat because links should not be treated as dirs 67 lstat(dir.c_str(),&buf); 68 // check if dir - if not delete the node 69 if (!(buf.st_mode & S_IFDIR)) { 70 // Make sure file is removable before removing it 71 chmod(dir.c_str(),S_IWRITE); 72 if (unlink(dir.c_str())) 73 throw FileDeleteError(dir); 74 return; 75 } 66 76 if (chdir(dir.c_str())) 67 77 throw BadDirectory(dir); … … 73 83 throw DirectoryOpenError(dir); 74 84 while ((entry=readdir(dp)) != NULL) { 75 struct stat buf;76 85 if ((std::string(entry->d_name) == ".") || 77 86 (std::string(entry->d_name) == "..")) 78 87 continue; 79 stat(entry->d_name,&buf); 80 if (buf.st_mode & S_IFDIR) 81 rmdirhier__(entry->d_name); // sub-directory 82 else { 83 // Make sure file is removable before removing it 84 chmod(entry->d_name,S_IWRITE); 85 if (unlink(entry->d_name)) 86 throw FileDeleteError(entry->d_name); 87 } 88 rmdirhier__(entry->d_name); 88 89 } 89 90 closedir(dp); -
branches/replacing_gnuplot/lib/rmdirhier.h
r519 r784 5 5 6 6 /* 7 Copyright (C) 2006 Jari Häkkinen , Peter Johansson8 Copyright (C) 2007 Peter Johansson7 Copyright (C) 2006 Jari Häkkinen 8 Copyright (C) 2007, 2008 Peter Johansson 9 9