[PATCH] add more support for dates with slashes (re-sending)

Matt Mackall mpm at selenic.com
Tue Nov 8 18:02:08 CST 2011


On Tue, 2011-11-08 at 22:47 +0000, Haszlakiewicz, Eric wrote:
> > -----Original Message-----
> > From: Matt Mackall [mailto:mpm at selenic.com]
> > 
> > On Tue, 2011-11-08 at 21:39 +0000, Haszlakiewicz, Eric wrote:
> > > Here's a patch that adds support for several additional date formats
> > > that use slashes instead of dashes (plus some more tests to make sure
> > > everything still works).
> > >
> > > # HG changeset patch
> > > # User Eric Haszlakiewicz <hawicz at gmail.com> # Date 1319215280 14400
> > # Node ID 89a5617493747a9e58a47a244a5091e0c381c921
> > 
> > Something interesting happened with linewrapping. Please consider using
> > patchbomb.
> 
> Oops, sorry.  That's probably because I cut-and-pasted my original email from Outlook's sent mail folder.
> 
> > > # Parent  d4addef0ec74370fbf75b138d06f8ad93d3038ff
> > > Support full date formats with slashes.
> > 
> > Incorrect summary format (period, uppercase, no subsystem).
> 
> I guess the subsystem would be "help/dates"?  

"dates: support full date formats with slashes"

> > The right way to test this sort of low-level utility functionality
> > these
> > days is with a doctest. See here for a nearby example of how this is
> > done:
> > 
> > http://www.selenic.com/hg/file/stable/mercurial/util.py#l1045
> 
> So http://mercurial.selenic.com/wiki/WritingTests and everything in the tests/ directory is obsolete?  Well, ok.

No. The key phrase above is "low-level utility functionality". A better
expression of this might be "purely-functional code with no side
effects, no I/O, trivial inputs, and compact, stable, and easy to
inspect outputs". So a function that parses URLs is a great candidate,
whereas a function that parses SSL certs is not.

> Are you expecting me to include moving all the tests from test-parse-date.t to util.py as part of my patch?

No, and in fact you shouldn't as that would be combining unrelated
changes ("adding new formats" and "migrating tests") in the same patch.
But if you want to start with a separate patch that moves the
doctest-appropriate tests, that'd be great.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list