3 # Copyright 2010-2011 Julien Valroff <julien@debian.org>
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; version 2
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 git log -1 --format='%cd.%h' --date=short | sed 's/-//g'
27 hg log --limit 1 | grep ^changeset | awk '{print $2}' | cut -d":" -f1
29 elif [ -d .bzr ]; then
32 bzr log -r-1 | grep ^revno: | sed 's/revno: //'
34 elif [ -d .svn ]; then
36 svn log -l1 | awk 'NR==2' | awk '{print $1}' | sed 's/^r//'
40 echo "Not in a VCS repository or unsupported VCS"