changeset 20095:1c46b18b0e1c

merge with stable
author Matt Mackall <mpm@selenic.com>
date Fri, 22 Nov 2013 17:26:58 -0600
parents abfe6a8e619b (current diff) 06ef32c3b4bb (diff)
children 85d9200ba9f0
files mercurial/commands.py mercurial/hbisect.py mercurial/hgweb/webcommands.py
diffstat 5 files changed, 30 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Nov 12 16:23:52 2013 +0900
+++ b/mercurial/commands.py	Fri Nov 22 17:26:58 2013 -0600
@@ -4513,7 +4513,7 @@
         rejected = [n for n in nodes
                     if newdata[cl.rev(n)] < targetphase]
         if rejected:
-            ui.warn(_('cannot move %i changesets to a more permissive '
+            ui.warn(_('cannot move %i changesets to a higher '
                       'phase, use --force\n') % len(rejected))
             ret = 1
         if changes:
--- a/mercurial/hbisect.py	Tue Nov 12 16:23:52 2013 +0900
+++ b/mercurial/hbisect.py	Fri Nov 22 17:26:58 2013 -0600
@@ -63,7 +63,8 @@
         badrev, ancestors = buildancestors(state['good'], state['bad'])
     bad = changelog.node(badrev)
     if not ancestors: # now we're confused
-        if len(state['bad']) == 1 and len(state['good']) == 1:
+        if (len(state['bad']) == 1 and len(state['good']) == 1 and
+            state['bad'] != state['good']):
             raise util.Abort(_("starting revisions are not directly related"))
         raise util.Abort(_("inconsistent state, %s:%s is good and bad")
                          % (badrev, short(bad)))
--- a/mercurial/hgweb/webcommands.py	Tue Nov 12 16:23:52 2013 +0900
+++ b/mercurial/hgweb/webcommands.py	Fri Nov 22 17:26:58 2013 -0600
@@ -228,9 +228,12 @@
     query = req.form['rev'][0]
     revcount = web.maxchanges
     if 'revcount' in req.form:
-        revcount = int(req.form.get('revcount', [revcount])[0])
-        revcount = max(revcount, 1)
-        tmpl.defaults['sessionvars']['revcount'] = revcount
+        try:
+            revcount = int(req.form.get('revcount', [revcount])[0])
+            revcount = max(revcount, 1)
+            tmpl.defaults['sessionvars']['revcount'] = revcount
+        except ValueError:
+            pass
 
     lessvars = copy.copy(tmpl.defaults['sessionvars'])
     lessvars['revcount'] = max(revcount / 2, 1)
@@ -307,9 +310,12 @@
 
     revcount = shortlog and web.maxshortchanges or web.maxchanges
     if 'revcount' in req.form:
-        revcount = int(req.form.get('revcount', [revcount])[0])
-        revcount = max(revcount, 1)
-        tmpl.defaults['sessionvars']['revcount'] = revcount
+        try:
+            revcount = int(req.form.get('revcount', [revcount])[0])
+            revcount = max(revcount, 1)
+            tmpl.defaults['sessionvars']['revcount'] = revcount
+        except ValueError:
+            pass
 
     lessvars = copy.copy(tmpl.defaults['sessionvars'])
     lessvars['revcount'] = max(revcount / 2, 1)
@@ -822,9 +828,12 @@
 
     revcount = web.maxshortchanges
     if 'revcount' in req.form:
-        revcount = int(req.form.get('revcount', [revcount])[0])
-        revcount = max(revcount, 1)
-        tmpl.defaults['sessionvars']['revcount'] = revcount
+        try:
+            revcount = int(req.form.get('revcount', [revcount])[0])
+            revcount = max(revcount, 1)
+            tmpl.defaults['sessionvars']['revcount'] = revcount
+        except ValueError:
+            pass
 
     lessvars = copy.copy(tmpl.defaults['sessionvars'])
     lessvars['revcount'] = max(revcount / 2, 1)
@@ -944,9 +953,12 @@
     bg_height = 39
     revcount = web.maxshortchanges
     if 'revcount' in req.form:
-        revcount = int(req.form.get('revcount', [revcount])[0])
-        revcount = max(revcount, 1)
-        tmpl.defaults['sessionvars']['revcount'] = revcount
+        try:
+            revcount = int(req.form.get('revcount', [revcount])[0])
+            revcount = max(revcount, 1)
+            tmpl.defaults['sessionvars']['revcount'] = revcount
+        except ValueError:
+            pass
 
     lessvars = copy.copy(tmpl.defaults['sessionvars'])
     lessvars['revcount'] = max(revcount / 2, 1)
--- a/tests/test-bisect.t	Tue Nov 12 16:23:52 2013 +0900
+++ b/tests/test-bisect.t	Fri Nov 22 17:26:58 2013 -0600
@@ -280,7 +280,7 @@
   $ hg bisect -r
   $ hg bisect -g tip
   $ hg bisect -b tip
-  abort: starting revisions are not directly related
+  abort: inconsistent state, 31:58c80a7c8a40 is good and bad
   [255]
 
   $ hg bisect -r
--- a/tests/test-phases.t	Tue Nov 12 16:23:52 2013 +0900
+++ b/tests/test-phases.t	Fri Nov 22 17:26:58 2013 -0600
@@ -482,7 +482,7 @@
 
   $ hg phase --public 7
   $ hg phase --draft '5 or 7'
-  cannot move 1 changesets to a more permissive phase, use --force
+  cannot move 1 changesets to a higher phase, use --force
   phase changed for 1 changesets
   [1]
   $ hg log -G --template "{rev} {phase} {desc}\n"
@@ -506,7 +506,7 @@
 test complete failure
 
   $ hg phase --draft 7
-  cannot move 1 changesets to a more permissive phase, use --force
+  cannot move 1 changesets to a higher phase, use --force
   no phases changed
   [1]