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

ttung at fb.com ttung at fb.com
Thu Jul 21 05:57:41 UTC 2016


# 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