mercurial/helptext/dates.txt
author Manuel Jacob <me@manueljacob.de>
Mon, 11 Jul 2022 01:51:20 +0200
branchstable
changeset 49378 094a5fa3cf52
parent 45957 d010adc483cc
permissions -rw-r--r--
procutil: make stream detection in make_line_buffered more correct and strict In make_line_buffered(), we don’t want to wrap the stream if we know that lines get flushed to the underlying raw stream already. Previously, the heuristic was too optimistic. It assumed that any stream which is not an instance of io.BufferedIOBase doesn’t need wrapping. However, there are buffered streams that aren’t instances of io.BufferedIOBase, like Mercurial’s own winstdout. The new logic is different in two ways: First, only for the check, if unwraps any combination of WriteAllWrapper and winstdout. Second, it skips wrapping the stream only if it is an instance of io.RawIOBase (or already wrapped). If it is an instance of io.BufferedIOBase, it gets wrapped. In any other case, the function raises an exception. This ensures that, if an unknown stream is passed or we add another wrapper in the future, we don’t wrap the stream if it’s already line buffered or not wrap the stream if it’s not line buffered. In fact, this was already helpful during development of this change. Without it, I possibly would have forgot that WriteAllWrapper needs to be ignored for the check, leading to unnecessary wrapping if stdout is unbuffered. The alternative would have been to always wrap unknown streams. However, I don’t think that anyone would benefit from being less strict. We can expect streams from the standard library to be subclassing either io.RawIOBase or io.BufferedIOBase, so running Mercurial in the standard way should not regress by this change. Py2exe might replace sys.stdout and sys.stderr, but that currently breaks Mercurial anyway and also these streams don’t claim to be interactive, so this function is not called for them.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
     1
Some commands allow the user to specify a date, e.g.:
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     2
9540
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
     3
- backout, commit, import, tag: Specify the commit date.
cad36e496640 help: un-indent help topics
Martin Geisler <mg@lazybytes.net>
parents: 9539
diff changeset
     4
- log, revert, update: Select revision(s) by date.
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     5
9893
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
     6
Many date formats are valid. Here are some examples:
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
     7
9893
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
     8
- ``Wed Dec 6 13:18:29 2006`` (local timezone assumed)
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
     9
- ``Dec 6 13:18 -0600`` (year assumed, time offset provided)
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    10
- ``Dec 6 13:18 UTC`` (UTC and GMT are aliases for +0000)
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    11
- ``Dec 6`` (midnight)
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    12
- ``13:18`` (today assumed)
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    13
- ``3:39`` (3:39AM assumed)
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    14
- ``3:39pm`` (15:39)
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    15
- ``2006-12-06 13:18:29`` (ISO 8601 format)
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    16
- ``2006-12-6 13:18``
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    17
- ``2006-12-6``
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    18
- ``12-6``
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    19
- ``12/6``
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    20
- ``12/6/6`` (Dec 6 2006)
18537
ae60735e37d2 dates: support 'today' and 'yesterday' in parsedate (issue3764)
Paul Cavallaro <ptc@fb.com>
parents: 13887
diff changeset
    21
- ``today`` (midnight)
ae60735e37d2 dates: support 'today' and 'yesterday' in parsedate (issue3764)
Paul Cavallaro <ptc@fb.com>
parents: 13887
diff changeset
    22
- ``yesterday`` (midnight)
18614
b2586e2cc67a parsedate: understand "now" as a shortcut for the current time
Augie Fackler <raf@durin42.com>
parents: 18537
diff changeset
    23
- ``now`` - right now
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    24
9893
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    25
Lastly, there is Mercurial's internal format:
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    26
19968
7bec3f697d76 doc: fix internal date sample (issue4072)
Pavlos Touboulidis <pav@pav.gr>
parents: 18614
diff changeset
    27
- ``1165411109 0`` (Wed Dec 6 13:18:29 2006 UTC)
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    28
13882
0a0988bd4818 help/dates: rephrase explanation of internal format
Martin Geisler <mg@aragost.com>
parents: 9999
diff changeset
    29
This is the internal representation format for dates. The first number
0a0988bd4818 help/dates: rephrase explanation of internal format
Martin Geisler <mg@aragost.com>
parents: 9999
diff changeset
    30
is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
0a0988bd4818 help/dates: rephrase explanation of internal format
Martin Geisler <mg@aragost.com>
parents: 9999
diff changeset
    31
second is the offset of the local timezone, in seconds west of UTC
0a0988bd4818 help/dates: rephrase explanation of internal format
Martin Geisler <mg@aragost.com>
parents: 9999
diff changeset
    32
(negative if the timezone is east of UTC).
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    33
9893
af873901b575 commands, dates: use real lists instead of literal blocks
Martin Geisler <mg@lazybytes.net>
parents: 9540
diff changeset
    34
The log command also accepts date ranges:
9539
c904e76e3834 help: move help topics from mercurial/help.py to help/*.txt
Martin Geisler <mg@lazybytes.net>
parents:
diff changeset
    35
13886
fe48c57390f2 help/dates: use DATE as place-holder in help and abort texts
Martin Geisler <mg@aragost.com>
parents: 9999
diff changeset
    36
- ``<DATE`` - at or before a given date/time
fe48c57390f2 help/dates: use DATE as place-holder in help and abort texts
Martin Geisler <mg@aragost.com>
parents: 9999
diff changeset
    37
- ``>DATE`` - on or after a given date/time
fe48c57390f2 help/dates: use DATE as place-holder in help and abort texts
Martin Geisler <mg@aragost.com>
parents: 9999
diff changeset
    38
- ``DATE to DATE`` - a date range, inclusive
45957
d010adc483cc help: fix a grammar/typo in hg help dates
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 43632
diff changeset
    39
- ``-DAYS`` - within a given number of days from today