changeset 561:897f6da2314e stable

fold: handle the lack of revision to fold
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Wed, 12 Sep 2012 14:24:23 +0200
parents 4580ff7157ae
children b1bdcb4506de b80de587d72d
files hgext/evolve.py tests/test-evolve.t
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/evolve.py	Tue Sep 11 16:19:27 2012 +0200
+++ b/hgext/evolve.py	Wed Sep 12 14:24:23 2012 +0200
@@ -2062,9 +2062,8 @@
     """Fold multiple revisions into a single one"""
     revs = list(revs)
     revs.extend(opts['rev'])
-    if not revs:
-        revs = ['.']
-    revs = scmutil.revrange(repo, revs)
+    if revs:
+        revs = scmutil.revrange(repo, revs)
     if not revs:
         ui.write_err('no revision to fold\n')
         return 1
--- a/tests/test-evolve.t	Tue Sep 11 16:19:27 2012 +0200
+++ b/tests/test-evolve.t	Wed Sep 12 14:24:23 2012 +0200
@@ -555,6 +555,9 @@
 Test fold
 
   $ rm *.orig
+  $ hg fold
+  no revision to fold
+  [1]
   $ hg fold 6::10
   2 changesets folded
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved