merge with stable
authorMatt Mackall <mpm@selenic.com>
Fri, 22 Nov 2013 17:26:58 -0600
changeset 20095 1c46b18b0e1c
parent 20091 abfe6a8e619b (current diff)
parent 20094 06ef32c3b4bb (diff)
child 20097 85d9200ba9f0
merge with stable
mercurial/commands.py
mercurial/hbisect.py
mercurial/hgweb/webcommands.py
--- 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]