"hg update -d" date selection

Giorgos Keramidas keramida at ceid.upatras.gr
Mon Feb 16 22:26:52 CST 2009


On Mon, 16 Feb 2009 17:23:03 -0800 (PST), icecream <johnforeplay at hotmail.com> wrote:
> "hg update -d" date selection
>
> anyone?

Dates are not a particularly well defined thing as a 'unique changeset
identifier' in a distributed SCM.  They are especially tricky when a
patch is developed in isolation and then 'hg import' is used to stack it
on top of an already modified source tree.

For example, here's a snippet from "graphlog" output for the repository
where we push translation patches for the Greek FreeBSD documentation
team:

  | o  1484   ed42b0834f2d   2009-02-12 18:09 +0200   keramida
  |/     Tiny wording fx
  |
  o  1483   3b9af4f0ade5   2009-02-04 09:00 +0200   speak
  |    Translate section 18.2 (disks chapter)
  |
  o    1482:1480,1481   722bbcdfdece   2009-02-11 13:18 +0200   keramida
  |\     Merge from ncvs
  | |
  | o  1481:1475   469e869be9c4   2009-02-11 03:46 +0000   ncvs
  | |    Import FreeBSD doc/ snapshot at 2009-02-11 03:46:04 +0000

Kiriakos (username: speak) translated parts of the 'disks' Handbook
chapter on 2009-02-04, and emailed me his patch at that date.  I had it
in my mailbox for a few days, and in the meantime merged from the
upstream documentation sources a few times.

This means that his patch at change 3b9af4f0ade5 is `dated' with a
timestamp that is *before* the parent changeset in the history.

Would it be surprising if you used "hg update -d '2009-02-12'" and got
revision 722bbcdfdece, but then got a 'future' changeset by using "hg
update -d '2009-02-15'"?  I think it would be at last a bit unsettling
or even confusing.

With multiple parallel lines of history in the same repository, it may
get even trickier.  If you had a history with timestamps like:


                              o  2009-02-10 18:33:17
     2009-02-10 18:33:10  o   |
                          |   |
                          |   |   o  2009-02-10 18:34:56
  2009-02-10 18:34:27  o  |   |   |
                       |  |   |   |  o  2009-02-10 18:33:42
                       |  |   |   |  |
                       \  |   |   |  /
                        \  \  |  /  /
                         \  \ | /  /
                          \  \|/  /
                           `--o--'
                              | 2009-02-10 18:33:27
                              |

and you used "hg update -d '2009-02-10 18:35:00'", which branch of the
history would you expect to get, and why?



More information about the Mercurial mailing list