Edgewall Software
Modify

Opened 14 years ago

Closed 11 years ago

#9945 closed defect (duplicate)

trac-admin version time showing incorrect error message

Reported by: Thijs Triemstra Owned by: Thijs Triemstra
Priority: normal Milestone:
Component: admin/console Version: 0.12-stable
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When you run:

trac-admin ../test2/ version time 2.0 10/12/12 12:12:12

it tells you the format should be 'YYYY-MM-DD':

Error: Invalid arguments

version time <name> <time>

    Set version date

    The <time> must be specified in the "YYYY-MM-DD" format. Alternatively,
    "now" can be used to set the version date to the current time. To remove
    the date from a version, specify an empty string ("").

But the error for strings is showing the format 'MM/DD/YY hh:mm:ss':

trac-admin ../test2/ version time 2.0 asd
TracError: "asd" is an invalid date, or the date format is not known. Try "MM/DD/YY hh:mm:ss" instead.

and it seems slashes work as well:

trac-admin ../test2/ version time 2.0 10/12/12

Attachments (0)

Change History (3)

in reply to:  description comment:1 by Remy Blank, 14 years ago

Replying to thijstriemstra:

trac-admin ../test2/ version time 2.0 10/12/12 12:12:12

This almost worked, you just forgot to quote the time:

trac-admin ../test2/ version time 2.0 "10/12/12 12:12:12"

it tells you the format should be 'YYYY-MM-DD':

The help is a static string, and the YYY-MM-DD format is always supported, so strictly speaking, it's correct. The server locale is also supported, which is what the error message mentions.

We could extend the error message to mention both the ISO format and the local format.

comment:2 by Thijs Triemstra, 14 years ago

Milestone: next-major-0.1X
Owner: set to Thijs Triemstra
Status: newassigned

comment:3 by Ryan J Ollos, 11 years ago

Milestone: next-major-releases
Resolution: duplicate
Status: assignedclosed

This was fixed in #11342. The behaviour now is:

$ trac-admin ../tracdev version time 2.0 10/12/12 12:12:12
Error: Invalid arguments

version time <name> <time>

    Set version date

    The <time> must be specified in the "MMM d, yyyy h:mm:ss a" or "YYYY-MM-
    DDThh:mm:ss±hh:mm" (ISO 8601) format. Alternatively, "now" can be used to
    set the version date to the current time. To remove the date from a
    version, specify an empty string ("").

$ trac-admin ../tracdev version time 2.0 "Oct 12, 2012 12:12:12 a"
$ trac-admin ../tracdev version time 2.0 "10/12/12 12:12:12"
$ trac-admin ../tracdev version time 2.0 asd
TracError: "asd" is an invalid date, or the date format is not known. Try "MMM d, yyyy h:mm:ss a" or "YYYY-MM-DDThh:mm:ss±hh:mm" instead.

We could mention in the hint that the date must be quoted if it contains whitespace. Let me know if you think that is important.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Thijs Triemstra.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Thijs Triemstra to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.