Patchwork obsolete: ensure all markers have a date

login
register
mail settings
Submitter Pierre-Yves David
Date March 28, 2013, 6 p.m.
Message ID <fc5388b69f50c5c50473.1364493645@crater1.logilab.fr>
Download mbox | patch
Permalink /patch/1206/
State Accepted
Commit e9331e979d7afe98c1a835d39900145c6b56b094
Headers show

Comments

Pierre-Yves David - March 28, 2013, 6 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1360578012 -3600
#      Mon Feb 11 11:20:12 2013 +0100
# Node ID fc5388b69f50c5c504736151898a4da0471811f8
# Parent  a7d0ddc7540b2691f8a5af8006588a80e582754a
obsolete: ensure all markers have a date

Obsolescence creates a sparse DAG mostly composed of a lot of small independent
chain of markers. Date is the only simple and "reliable" way to sort them. The
existence of a date is now enforced at creation time as I'm more and more
convinced that date will have a key role in obsolescence markers exchange.
Pierre-Yves David - April 12, 2013, 9:54 a.m.
Gentle ping on this patch

On Thu, Mar 28, 2013 at 07:00:45PM +0100, pierre-yves.david@logilab.fr wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1360578012 -3600
> #      Mon Feb 11 11:20:12 2013 +0100
> # Node ID fc5388b69f50c5c504736151898a4da0471811f8
> # Parent  a7d0ddc7540b2691f8a5af8006588a80e582754a
> obsolete: ensure all markers have a date
> 
> Obsolescence creates a sparse DAG mostly composed of a lot of small independent
> chain of markers. Date is the only simple and "reliable" way to sort them. The
> existence of a date is now enforced at creation time as I'm more and more
> convinced that date will have a key role in obsolescence markers exchange.
> 
> diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
> --- a/mercurial/obsolete.py
> +++ b/mercurial/obsolete.py
> @@ -248,10 +248,12 @@ class obsstore(object):
>          * check mandatory metadata
>          * encode metadata
>          """
>          if metadata is None:
>              metadata = {}
> +        if 'date' not in metadata:
> +            metadata['date'] = "%d %d" % util.makedate()
>          if len(prec) != 20:
>              raise ValueError(prec)
>          for succ in succs:
>              if len(succ) != 20:
>                  raise ValueError(succ)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Bryan O'Sullivan - April 12, 2013, 4:39 p.m.
On Thu, Mar 28, 2013 at 11:00 AM, <pierre-yves.david@logilab.fr> wrote:

> obsolete: ensure all markers have a date
>

Pushed to crew, thanks.

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -248,10 +248,12 @@  class obsstore(object):
         * check mandatory metadata
         * encode metadata
         """
         if metadata is None:
             metadata = {}
+        if 'date' not in metadata:
+            metadata['date'] = "%d %d" % util.makedate()
         if len(prec) != 20:
             raise ValueError(prec)
         for succ in succs:
             if len(succ) != 20:
                 raise ValueError(succ)