From: idl0r Date: Thu, 7 May 2009 13:46:32 +0000 (-0000) Subject: Add hg/mercurial support. X-Git-Tag: gentoolkit-dev-0.2.6.12~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bea0beeb039db318c146994a393ed1b51bd3658d;p=gentoolkit.git Add hg/mercurial support. svn path=/trunk/gentoolkit-dev/; revision=618 --- 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; } } }