Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 30525:ef1353c283e3
debugcommands: move 'debugdate' in the new module
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 17 Aug 2016 20:43:31 -0700 |
parents | cdd1885d0f2f |
children | a3ec6db36315 |
comparison
equal
deleted
inserted
replaced
30524:cdd1885d0f2f | 30525:ef1353c283e3 |
---|---|
1863 Returns 0 on success, 1 if errors are encountered. | 1863 Returns 0 on success, 1 if errors are encountered. |
1864 """ | 1864 """ |
1865 with repo.wlock(False): | 1865 with repo.wlock(False): |
1866 return cmdutil.copy(ui, repo, pats, opts) | 1866 return cmdutil.copy(ui, repo, pats, opts) |
1867 | 1867 |
1868 @command('debugdate', | |
1869 [('e', 'extended', None, _('try extended date formats'))], | |
1870 _('[-e] DATE [RANGE]'), | |
1871 norepo=True, optionalrepo=True) | |
1872 def debugdate(ui, date, range=None, **opts): | |
1873 """parse and display a date""" | |
1874 if opts["extended"]: | |
1875 d = util.parsedate(date, util.extendeddateformats) | |
1876 else: | |
1877 d = util.parsedate(date) | |
1878 ui.write(("internal: %s %s\n") % d) | |
1879 ui.write(("standard: %s\n") % util.datestr(d)) | |
1880 if range: | |
1881 m = util.matchdate(range) | |
1882 ui.write(("match: %s\n") % m(d[0])) | |
1883 | |
1884 @command('debugdiscovery', | 1868 @command('debugdiscovery', |
1885 [('', 'old', None, _('use old-style discovery')), | 1869 [('', 'old', None, _('use old-style discovery')), |
1886 ('', 'nonheads', None, | 1870 ('', 'nonheads', None, |
1887 _('use old-style discovery with non-heads included')), | 1871 _('use old-style discovery with non-heads included')), |
1888 ] + remoteopts, | 1872 ] + remoteopts, |