merge with stable
authorMatt Mackall <mpm@selenic.com>
Tue, 11 Nov 2014 18:43:19 -0600
changeset 23266 3480c07fc934
parent 23263 dd51abf0aa17 (current diff)
parent 23246 643c58303fb0 (diff)
child 23267 d7ce6e56b070
merge with stable
hgext/rebase.py
--- a/hgext/rebase.py	Mon Nov 10 13:20:56 2014 -0500
+++ b/hgext/rebase.py	Tue Nov 11 18:43:19 2014 -0600
@@ -274,8 +274,12 @@
                                 "can't compute rebase set\n"))
                     return 1
                 commonanc = repo.revs('ancestor(%ld, %d)', base, dest).first()
-                rebaseset = repo.revs('(%d::(%ld) - %d)::',
-                                      commonanc, base, commonanc)
+                if commonanc is not None:
+                    rebaseset = repo.revs('(%d::(%ld) - %d)::',
+                                          commonanc, base, commonanc)
+                else:
+                    rebaseset = []
+
                 if not rebaseset:
                     # transform to list because smartsets are not comparable to
                     # lists. This should be improved to honor laziness of
--- a/tests/test-rebase-parameters.t	Mon Nov 10 13:20:56 2014 -0500
+++ b/tests/test-rebase-parameters.t	Tue Nov 11 18:43:19 2014 -0600
@@ -468,3 +468,17 @@
   [255]
 
   $ cd ..
+
+No common ancestor
+
+  $ hg init separaterepo
+  $ cd separaterepo
+  $ touch a
+  $ hg commit -Aqm a
+  $ hg up -q null
+  $ touch b
+  $ hg commit -Aqm b
+  $ hg rebase -d 0
+  nothing to rebase from d7486e00c6f1 to 3903775176ed
+  [1]
+  $ cd ..
--- a/tests/test-run-tests.t	Mon Nov 10 13:20:56 2014 -0500
+++ b/tests/test-run-tests.t	Tue Nov 11 18:43:19 2014 -0600
@@ -416,22 +416,22 @@
   $ cat report.json
   testreport ={
       "test-failure.t": [\{] (re)
-          "csys": "\s*[\d\.]{5}",  (re)
-          "cuser": "\s*[\d\.]{5}",  (re)
-          "result": "failure", 
-          "time": "\s*[\d\.]{5}" (re)
-      }, 
+          "csys": "\s*[\d\.]{4,5}", ? (re)
+          "cuser": "\s*[\d\.]{4,5}", ? (re)
+          "result": "failure", ? (re)
+          "time": "\s*[\d\.]{4,5}" (re)
+      }, ? (re)
       "test-skip.t": {
-          "csys": "\s*[\d\.]{5}",  (re)
-          "cuser": "\s*[\d\.]{5}",  (re)
-          "result": "skip", 
-          "time": "\s*[\d\.]{5}" (re)
-      }, 
+          "csys": "\s*[\d\.]{4,5}", ? (re)
+          "cuser": "\s*[\d\.]{4,5}", ? (re)
+          "result": "skip", ? (re)
+          "time": "\s*[\d\.]{4,5}" (re)
+      }, ? (re)
       "test-success.t": [\{] (re)
-          "csys": "\s*[\d\.]{5}",  (re)
-          "cuser": "\s*[\d\.]{5}",  (re)
-          "result": "success", 
-          "time": "\s*[\d\.]{5}" (re)
+          "csys": "\s*[\d\.]{4,5}", ? (re)
+          "cuser": "\s*[\d\.]{4,5}", ? (re)
+          "result": "success", ? (re)
+          "time": "\s*[\d\.]{4,5}" (re)
       }
   } (no-eol)