fold: handle the lack of revision to fold stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 12 Sep 2012 14:24:23 +0200
branchstable
changeset 561 897f6da2314e
parent 560 4580ff7157ae
child 562 b1bdcb4506de
child 607 b80de587d72d
fold: handle the lack of revision to fold
hgext/evolve.py
tests/test-evolve.t
--- 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