changeset 9963:a68fb6f4ae4b

Merge with crew
author Matt Mackall <mpm@selenic.com>
date Mon, 30 Nov 2009 15:31:14 -0600
parents 652064640e98 (current diff) a7178eccf2dc (diff)
children e600ad9bc257
files mercurial/cmdutil.py
diffstat 6 files changed, 46 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/convcmd.py	Sat Nov 28 11:21:19 2009 +0900
+++ b/hgext/convert/convcmd.py	Mon Nov 30 15:31:14 2009 -0600
@@ -48,6 +48,8 @@
 
 def convertsource(ui, path, type, rev):
     exceptions = []
+    if type and type not in [s[0] for s in source_converters]:
+        raise util.Abort(_('%s: invalid source repository type') % type)
     for name, source, sortmode in source_converters:
         try:
             if not type or name == type:
@@ -60,6 +62,8 @@
     raise util.Abort(_('%s: missing or unsupported repository') % path)
 
 def convertsink(ui, path, type):
+    if type and type not in [s[0] for s in sink_converters]:
+        raise util.Abort(_('%s: invalid destination repository type') % type)
     for name, sink in sink_converters:
         try:
             if not type or name == type:
--- a/mercurial/cmdutil.py	Sat Nov 28 11:21:19 2009 +0900
+++ b/mercurial/cmdutil.py	Mon Nov 30 15:31:14 2009 -0600
@@ -755,7 +755,8 @@
                                      cache={
                                          'parent': '{rev}:{node|formatnode} ',
                                          'manifest': '{rev}:{node|formatnode}',
-                                         'filecopy': '{name} ({source})'})
+                                         'filecopy': '{name} ({source})',
+                                         'extra': '{key}={value|stringescape}'})
         # Cache mapping from rev to a tuple with tag date, tag
         # distance and tag name
         self._latesttagcache = {-1: (0, 0, 'null')}
--- a/tests/test-command-template	Sat Nov 28 11:21:19 2009 +0900
+++ b/tests/test-command-template	Mon Nov 30 15:31:14 2009 -0600
@@ -93,7 +93,7 @@
 
 echo "# keys work"
 for key in author branches date desc file_adds file_dels file_mods \
-        files manifest node parents rev tags diffstat; do
+        files manifest node parents rev tags diffstat extras; do
     for mode in '' --verbose --debug; do
         hg log $mode --template "$key$mode: {$key}\n"
     done
--- a/tests/test-command-template.out	Sat Nov 28 11:21:19 2009 +0900
+++ b/tests/test-command-template.out	Mon Nov 30 15:31:14 2009 -0600
@@ -569,6 +569,33 @@
 diffstat--debug: 1: +4/-0
 diffstat--debug: 1: +2/-0
 diffstat--debug: 1: +1/-0
+extras: branch=default
+extras: branch=default
+extras: branch=default
+extras: branch=default
+extras: branch=foo
+extras: branch=default
+extras: branch=default
+extras: branch=default
+extras: branch=default
+extras--verbose: branch=default
+extras--verbose: branch=default
+extras--verbose: branch=default
+extras--verbose: branch=default
+extras--verbose: branch=foo
+extras--verbose: branch=default
+extras--verbose: branch=default
+extras--verbose: branch=default
+extras--verbose: branch=default
+extras--debug: branch=default
+extras--debug: branch=default
+extras--debug: branch=default
+extras--debug: branch=default
+extras--debug: branch=foo
+extras--debug: branch=default
+extras--debug: branch=default
+extras--debug: branch=default
+extras--debug: branch=default
 # filters work
 
 hostname
--- a/tests/test-convert	Sat Nov 28 11:21:19 2009 +0900
+++ b/tests/test-convert	Mon Nov 30 15:31:14 2009 -0600
@@ -50,3 +50,10 @@
 # override $PATH to ensure p4 not visible; use $PYTHON in case we're
 # running from a devel copy, not a temp installation
 PATH=$BINDIR $PYTHON $BINDIR/hg convert emptydir 2>&1 | sed 's,file://.*/emptydir,.../emptydir,g'
+
+echo % convert with imaginary source type
+hg convert --source-type foo a a-foo
+echo % convert with imaginary sink type
+hg convert --dest-type foo a a-foo
+
+true
--- a/tests/test-convert.out	Sat Nov 28 11:21:19 2009 +0900
+++ b/tests/test-convert.out	Mon Nov 30 15:31:14 2009 -0600
@@ -259,3 +259,8 @@
 emptydir does not look like a Bazaar repo
 cannot find required "p4" tool
 abort: emptydir: missing or unsupported repository
+% convert with imaginary source type
+initializing destination a-foo repository
+abort: foo: invalid source repository type
+% convert with imaginary sink type
+abort: foo: invalid destination repository type