Patchwork [04,of,21,RFC] filelog: parsemeta stops returning unused key list

login
register
mail settings
Submitter michaeljedgar@gmail.com
Date Sept. 11, 2014, 12:26 a.m.
Message ID <0af0c1b78745c99d7b78.1410395165@adgar-macbookpro3.roam.corp.google.com>
Download mbox | patch
Permalink /patch/5779/
State Accepted
Commit 75bb7c702317dabee6356ef516e6de6a0ca670b5
Headers show

Comments

michaeljedgar@gmail.com - Sept. 11, 2014, 12:26 a.m.
# HG changeset patch
# User Mike Edgar <adgar@google.com>
# Date 1409683350 14400
#      Tue Sep 02 14:42:30 2014 -0400
# Node ID 0af0c1b78745c99d7b783dcaf431f650de5c00c8
# Parent  c0a3869d01b083463c70bcf5dc7476e6711a50c5
filelog: parsemeta stops returning unused key list

Currently, only the returned meta dictionary is used. An upcoming change will
use the returned text offset.
Matt Mackall - Sept. 11, 2014, 6:45 p.m.
On Wed, 2014-09-10 at 20:26 -0400, michaeljedgar@gmail.com wrote:
> # HG changeset patch
> # User Mike Edgar <adgar@google.com>
> # Date 1409683350 14400
> #      Tue Sep 02 14:42:30 2014 -0400
> # Node ID 0af0c1b78745c99d7b783dcaf431f650de5c00c8
> # Parent  c0a3869d01b083463c70bcf5dc7476e6711a50c5
> filelog: parsemeta stops returning unused key list

FYI, I queued these bits:

@  9df1 adgar tip  @
|  filelog: parsemeta stops returning unused key list
o  dcd9 adgar
|  filelog: make parsemeta a public module function, to be used by censor module
o  97519 adgar
|  filelog: make packmeta a public module function, to be used by censor

Patch

diff -r c0a3869d01b0 -r 0af0c1b78745 mercurial/filelog.py
--- a/mercurial/filelog.py	Wed Sep 03 15:59:03 2014 -0400
+++ b/mercurial/filelog.py	Tue Sep 02 14:42:30 2014 -0400
@@ -13,16 +13,14 @@ 
     """return (metadatadict, keylist, metadatasize)"""
     # text can be buffer, so we can't use .startswith or .index
     if text[:2] != '\1\n':
-        return None, None, None
+        return None, None
     s = _mdre.search(text, 2).start()
     mtext = text[2:s]
     meta = {}
-    keys = []
     for l in mtext.splitlines():
         k, v = l.split(": ", 1)
         meta[k] = v
-        keys.append(k)
-    return meta, keys, (s + 2)
+    return meta, (s + 2)
 
 def _packmeta(meta, keys=None):
     if not keys: