[PATCH 1 of 3 V2] util: add method to hash nested combination of python data structures

Matt Mackall mpm at selenic.com
Mon Jul 6 15:30:24 CDT 2015


On Mon, 2015-07-06 at 14:53 -0400, Jordi GutiƩrrez Hermoso wrote:
> On Mon, 2015-07-06 at 11:42 -0700, Laurent Charignon wrote:
> > # HG changeset patch
> > # User Laurent Charignon <lcharignon at fb.com>
> > # Date 1435794507 25200
> > #      Wed Jul 01 16:48:27 2015 -0700
> > # Node ID 38cd2c6265855f0a8e65e02e2cc181921df498ca
> > # Parent  2748bf78a5bf610da4f2d90fd1eea19a3b360c04
> > util: add method to hash nested combination of python data structures
> > 
> > The goal of this series of patches is to have a method to compute the hash of
> > config objects. This will enable restarting the command server when the config
> > change.
> > This patch adds a method to compute the hash of nested combination of basic
> > data structure, it will be used to enable computing the hash of a sortdict and
> > in turn compute the hash of a config.
> > 
> > Implementation modified from:
> > http://stackoverflow.com/questions/5884066/hashing-a-python-dictionary
> 
> Is it a trivial enough amount of code so that we don't have to worry
> about the CC-BY-SA 3.0 license on the original code?

The above is actually not true in v2. It's now roughly my example code
posted last week.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list