From bea0beeb039db318c146994a393ed1b51bd3658d Mon Sep 17 00:00:00 2001 From: idl0r Date: Thu, 7 May 2009 13:46:32 +0000 Subject: [PATCH] Add hg/mercurial support. svn path=/trunk/gentoolkit-dev/; revision=618 --- src/echangelog/echangelog | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/echangelog/echangelog b/src/echangelog/echangelog index c27834d..9b71f8b 100755 --- a/src/echangelog/echangelog +++ b/src/echangelog/echangelog @@ -53,6 +53,15 @@ my %vcs = ( skip => 4, regex => qr/^diff \-\-git \S*\/((\S*)\.ebuild)/ }, + hg => { + diff => "hg diff", + status => "hg status .", + add => "hg add", + skip => 3, + # hg diff is relative to the root. + # TODO: Write a proper regex :) + regex => qr/diff \-r \S+ \S+\/\S+\/((\S+)\.ebuild)/ + }, ); sub usage { @@ -166,7 +175,13 @@ if ( -d "CVS" ) { open(GIT, '-|', "git rev-parse --git-dir 2>/dev/null"); $vcs = "git" if defined(); close(GIT); - last; + last if $vcs; + } + if ( -X "$path/hg" ) { + open(HG, '-|', "hg root 2>/dev/null"); + $vcs = "hg" if defined(); + close(HG); + last if $vcs; } } } -- 2.26.2