Patchwork [1,of,2] obsstore: update create docstring to point to the coder friendly function

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 14, 2014, 11:47 p.m.
Message ID <1bfd796fc968827d75b2.1392421672@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/3664/
State Accepted
Commit 3af218cf20079a51bfb9df393b3bac334b77b6f9
Headers show

Comments

Pierre-Yves David - Feb. 14, 2014, 11:47 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1392341625 28800
#      Thu Feb 13 17:33:45 2014 -0800
# Node ID 1bfd796fc968827d75b20abb7ef9d8d27d7d8e68
# Parent  0f1ef9e9e904c18f1ac96aef3a0e0d3aa5f1190c
obsstore: update create docstring to point to the coder friendly function

The `obsstore` class have a `create` method that create new obsolescence marker
from node. There is another function in the same module `createmarkers`. This
other function is higher level and automatically missing meta data (ultimately
calling the first one)

We add a new comment in the docstring of `obsstore.create` highlighting that
people writing new code probably want to use the top level one.

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -254,10 +254,13 @@  class obsstore(object):
         """obsolete: add a new obsolete marker
 
         * ensuring it is hashable
         * check mandatory metadata
         * encode metadata
+
+        If you are a human writing code creating marker you want to use the
+        `createmarkers` function in this module instead.
         """
         if metadata is None:
             metadata = {}
         if 'date' not in metadata:
             metadata['date'] = "%d %d" % util.makedate()