[PATCH remotenames V3] remotenames: remove support for old remotenames file format

Jun Wu quark at fb.com
Thu Jul 21 07:54:43 EDT 2016


I love this 100ms speed-up. If we want to support the old format, I think it
is doable by making "branches" lazy and testing "if rname in bookmarks"
first. Alternatively, we may want to find a way to disable "branches"
more completely.

I prefer dropping support. Will let smf decide.


Excerpts from ttung's message of 2016-07-20 22:57:41 -0700:
> # HG changeset patch
> # User Tony Tung <tonytung at merly.org>
> # Date 1469080576 25200
> #      Wed Jul 20 22:56:16 2016 -0700
> # Node ID a216bfe47256fa157f7bc1fb80e10d91918f95b6
> # Parent  183d5b47f7472b839a96e7be735bb7fbf8068969
> remotenames: remove support for old remotenames file format
> 
> This can cost up to 100ms when we don't need it on startup time.
> 
> Things that I've based this number on: 5 runs each of hg status, hg bookmark.
> 
> diff --git a/remotenames.py b/remotenames.py
> --- a/remotenames.py
> +++ b/remotenames.py
> @@ -1229,10 +1229,6 @@
>      if not vfs.exists('remotenames'):
>          return
>  
> -    # needed to heuristically determine if a file is in the old format
> -    branches = repo.names['branches'].listnames(repo)
> -    bookmarks = repo.names['bookmarks'].listnames(repo)
> -
>      f = vfs('remotenames')
>      for line in f:
>          nametype = None
> @@ -1254,14 +1250,6 @@
>          if not rname:
>              continue
>  
> -        # old format didn't save the nametype, so check for the name in
> -        # branches and bookmarks
> -        if nametype is None:
> -            if rname in branches:
> -                nametype = 'branches'
> -            elif rname in bookmarks:
> -                nametype = 'bookmarks'
> -
>          yield node, nametype, remote, rname
>  
>      f.close()


More information about the Mercurial-devel mailing list