--- a/hgext/churn.py Sun Apr 26 01:49:12 2009 +0200
+++ b/hgext/churn.py Wed Apr 29 20:03:54 2009 +0200
@@ -10,7 +10,7 @@
from mercurial.i18n import _
from mercurial import patch, cmdutil, util, templater
-import sys
+import sys, os
import time, datetime
def maketemplater(ui, repo, tmpl):
@@ -116,12 +116,18 @@
The map file format used to specify aliases is fairly simple:
- <alias email> <actual email>'''
+ <alias email> <actual email>
+
+ By default .hgchurn in the working directory root will be used, if
+ it exists. Use the --aliases option to override this.
+ '''
def pad(s, l):
return (s + " " * l)[:l]
amap = {}
aliases = opts.get('aliases')
+ if not aliases and os.path.exists(repo.wjoin('.hgchurn')):
+ aliases = repo.wjoin('.hgchurn')
if aliases:
for l in open(aliases, "r"):
l = l.strip()
--- a/tests/test-churn Sun Apr 26 01:49:12 2009 +0200
+++ b/tests/test-churn Wed Apr 29 20:03:54 2009 +0200
@@ -39,6 +39,10 @@
user3 alias3
EOF
hg churn --aliases ../aliases
+echo % churn with .hgchurn
+mv ../aliases .hgchurn
+hg churn
+rm .hgchurn
echo % churn with column specifier
COLUMNS=40 hg churn
echo % churn by hour
--- a/tests/test-churn.out Sun Apr 26 01:49:12 2009 +0200
+++ b/tests/test-churn.out Wed Apr 29 20:03:54 2009 +0200
@@ -15,6 +15,10 @@
alias3 3 **************************************************************
alias1 3 **************************************************************
user2 2 *****************************************
+% churn with .hgchurn
+alias3 3 **************************************************************
+alias1 3 **************************************************************
+user2 2 *****************************************
% churn with column specifier
user3 3 ***********************
user1 3 ***********************