Patchwork [stable] revlog: use "True" instead of "1" as while condition

login
register
mail settings
Submitter Pierre-Yves David
Date June 14, 2014, 4:41 a.m.
Message ID <825652c7451f155c0b99.1402720864@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5004/
State Not Applicable
Headers show

Comments

Pierre-Yves David - June 14, 2014, 4:41 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1402720754 25200
#      Fri Jun 13 21:39:14 2014 -0700
# Branch stable
# Node ID 825652c7451f155c0b9987d59a92bda5a3fe8b84
# Parent  f13728d59c0e146060649986041af35ec7b3f8c9
revlog: use "True" instead of "1" as while condition

Check-code says hi.
Siddharth Agarwal - June 14, 2014, 5:02 p.m.
On 06/13/2014 09:41 PM, pierre-yves.david@ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1402720754 25200
> #      Fri Jun 13 21:39:14 2014 -0700
> # Branch stable
> # Node ID 825652c7451f155c0b9987d59a92bda5a3fe8b84
> # Parent  f13728d59c0e146060649986041af35ec7b3f8c9
> revlog: use "True" instead of "1" as while condition
>
> Check-code says hi.

Looks like mpm just fixed this independently.

>
> diff --git a/mercurial/revlog.py b/mercurial/revlog.py
> --- a/mercurial/revlog.py
> +++ b/mercurial/revlog.py
> @@ -917,11 +917,11 @@ class revlog(object):
>           l = []
>           ladd = l.append
>   
>           # preload the cache
>           try:
> -            while 1:
> +            while True:
>                   # ensure that the cache doesn't change out from under us
>                   _cache = self._chunkcache
>                   self._chunkraw(revs[0], revs[-1])
>                   if _cache == self._chunkcache:
>                       break
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -917,11 +917,11 @@  class revlog(object):
         l = []
         ladd = l.append
 
         # preload the cache
         try:
-            while 1:
+            while True:
                 # ensure that the cache doesn't change out from under us
                 _cache = self._chunkcache
                 self._chunkraw(revs[0], revs[-1])
                 if _cache == self._chunkcache:
                     break