[PATCH 2 of 5] tests: use `hg help dates` instead of `hg help revs` in test

Martin von Zweigbergk martinvonz at google.com
Thu Jan 12 02:24:31 EST 2017


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1484163640 28800
#      Wed Jan 11 11:40:40 2017 -0800
# Node ID e57922b04e9004bd580888148b4cb898b629b7b2
# Parent  b75ebd3e375f85852b81aabc64639457ff796328
tests: use `hg help dates` instead of `hg help revs` in test

The revisions help is already long and will get longer, so switch to
another short and stable topic.

diff -r b75ebd3e375f -r e57922b04e90 tests/test-help.t
--- a/tests/test-help.t	Wed Jan 11 11:28:54 2017 -0800
+++ b/tests/test-help.t	Wed Jan 11 11:40:40 2017 -0800
@@ -1154,37 +1154,49 @@
 
 Test a help topic
 
-  $ hg help revs
-  Specifying Single Revisions
-  """""""""""""""""""""""""""
-  
-      Mercurial supports several ways to specify individual revisions.
-  
-      A plain integer is treated as a revision number. Negative integers are
-      treated as sequential offsets from the tip, with -1 denoting the tip, -2
-      denoting the revision prior to the tip, and so forth.
-  
-      A 40-digit hexadecimal string is treated as a unique revision identifier.
-      A hexadecimal string less than 40 characters long is treated as a unique
-      revision identifier and is referred to as a short-form identifier. A
-      short-form identifier is only valid if it is the prefix of exactly one
-      full-length identifier.
-  
-      Any other string is treated as a bookmark, tag, or branch name. A bookmark
-      is a movable pointer to a revision. A tag is a permanent name associated
-      with a revision. A branch name denotes the tipmost open branch head of
-      that branch - or if they are all closed, the tipmost closed head of the
-      branch. Bookmark, tag, and branch names must not contain the ":"
-      character.
-  
-      The reserved name "tip" always identifies the most recent revision.
-  
-      The reserved name "null" indicates the null revision. This is the revision
-      of an empty repository, and the parent of revision 0.
-  
-      The reserved name "." indicates the working directory parent. If no
-      working directory is checked out, it is equivalent to null. If an
-      uncommitted merge is in progress, "." is the revision of the first parent.
+  $ hg help dates
+  Date Formats
+  """"""""""""
+  
+      Some commands allow the user to specify a date, e.g.:
+  
+      - backout, commit, import, tag: Specify the commit date.
+      - log, revert, update: Select revision(s) by date.
+  
+      Many date formats are valid. Here are some examples:
+  
+      - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
+      - "Dec 6 13:18 -0600" (year assumed, time offset provided)
+      - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
+      - "Dec 6" (midnight)
+      - "13:18" (today assumed)
+      - "3:39" (3:39AM assumed)
+      - "3:39pm" (15:39)
+      - "2006-12-06 13:18:29" (ISO 8601 format)
+      - "2006-12-6 13:18"
+      - "2006-12-6"
+      - "12-6"
+      - "12/6"
+      - "12/6/6" (Dec 6 2006)
+      - "today" (midnight)
+      - "yesterday" (midnight)
+      - "now" - right now
+  
+      Lastly, there is Mercurial's internal format:
+  
+      - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
+  
+      This is the internal representation format for dates. The first number is
+      the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
+      is the offset of the local timezone, in seconds west of UTC (negative if
+      the timezone is east of UTC).
+  
+      The log command also accepts date ranges:
+  
+      - "<DATE" - at or before a given date/time
+      - ">DATE" - on or after a given date/time
+      - "DATE to DATE" - a date range, inclusive
+      - "-DAYS" - within a given number of days of today
 
 Test repeated config section name
 
@@ -2729,7 +2741,7 @@
   </html>
   
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT "help/revisions"
+  $ get-with-headers.py 127.0.0.1:$HGPORT "help/dates"
   200 Script output follows
   
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
@@ -2740,7 +2752,7 @@
   <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
   <script type="text/javascript" src="/static/mercurial.js"></script>
   
-  <title>Help: revisions</title>
+  <title>Help: dates</title>
   </head>
   <body>
   
@@ -2764,7 +2776,7 @@
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>Help: revisions</h3>
+  <h3>Help: dates</h3>
   
   <form class="search" action="/log">
   
@@ -2773,42 +2785,56 @@
   number or hash, or <a href="/help/revsets">revset expression</a>.</div>
   </form>
   <div id="doc">
-  <h1>Specifying Single Revisions</h1>
+  <h1>Date Formats</h1>
   <p>
-  Mercurial supports several ways to specify individual revisions.
+  Some commands allow the user to specify a date, e.g.:
   </p>
+  <ul>
+   <li> backout, commit, import, tag: Specify the commit date.
+   <li> log, revert, update: Select revision(s) by date.
+  </ul>
   <p>
-  A plain integer is treated as a revision number. Negative integers are
-  treated as sequential offsets from the tip, with -1 denoting the tip,
-  -2 denoting the revision prior to the tip, and so forth.
+  Many date formats are valid. Here are some examples:
   </p>
+  <ul>
+   <li> "Wed Dec 6 13:18:29 2006" (local timezone assumed)
+   <li> "Dec 6 13:18 -0600" (year assumed, time offset provided)
+   <li> "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
+   <li> "Dec 6" (midnight)
+   <li> "13:18" (today assumed)
+   <li> "3:39" (3:39AM assumed)
+   <li> "3:39pm" (15:39)
+   <li> "2006-12-06 13:18:29" (ISO 8601 format)
+   <li> "2006-12-6 13:18"
+   <li> "2006-12-6"
+   <li> "12-6"
+   <li> "12/6"
+   <li> "12/6/6" (Dec 6 2006)
+   <li> "today" (midnight)
+   <li> "yesterday" (midnight)
+   <li> "now" - right now
+  </ul>
   <p>
-  A 40-digit hexadecimal string is treated as a unique revision identifier.
-  A hexadecimal string less than 40 characters long is treated as a
-  unique revision identifier and is referred to as a short-form
-  identifier. A short-form identifier is only valid if it is the prefix
-  of exactly one full-length identifier.
+  Lastly, there is Mercurial's internal format:
+  </p>
+  <ul>
+   <li> "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
+  </ul>
+  <p>
+  This is the internal representation format for dates. The first number
+  is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
+  second is the offset of the local timezone, in seconds west of UTC
+  (negative if the timezone is east of UTC).
   </p>
   <p>
-  Any other string is treated as a bookmark, tag, or branch name. A
-  bookmark is a movable pointer to a revision. A tag is a permanent name
-  associated with a revision. A branch name denotes the tipmost open branch head
-  of that branch - or if they are all closed, the tipmost closed head of the
-  branch. Bookmark, tag, and branch names must not contain the ":" character.
-  </p>
-  <p>
-  The reserved name "tip" always identifies the most recent revision.
+  The log command also accepts date ranges:
   </p>
-  <p>
-  The reserved name "null" indicates the null revision. This is the
-  revision of an empty repository, and the parent of revision 0.
-  </p>
-  <p>
-  The reserved name "." indicates the working directory parent. If no
-  working directory is checked out, it is equivalent to null. If an
-  uncommitted merge is in progress, "." is the revision of the first
-  parent.
-  </p>
+  <ul>
+   <li> "<DATE" - at or before a given date/time
+   <li> ">DATE" - on or after a given date/time
+   <li> "DATE to DATE" - a date range, inclusive
+   <li> "-DAYS" - within a given number of days of today
+  </ul>
   
   </div>
   </div>


More information about the Mercurial-devel mailing list