changeset 10171:542279f81203

Merge with i18n
author Matt Mackall <mpm@selenic.com>
date Wed, 30 Dec 2009 14:32:37 -0600
parents 910196cdfa9c (current diff) 3acfb69a4729 (diff)
children 513c89a60f20
files tests/run-tests.py
diffstat 6 files changed, 313 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/xml.rnc	Wed Dec 30 14:32:37 2009 -0600
@@ -0,0 +1,41 @@
+# RelaxNG schema for "xml" log style
+# Inspired by Subversion's XML log format.
+
+start = log
+node.type = xsd:string  {minLength = "40" maxLength = "40"}
+
+log = element log { logentry+ }
+logentry = element logentry {
+    logentry.attlist,
+    branch*, tag*, hgparent*,
+    author, date,
+    msg, paths?, copies?, extra*
+}
+logentry.attlist =
+    attribute revision {xsd:nonNegativeInteger}
+  & attribute node {node.type}
+branch = element branch { text }
+tag = element tag { text }
+hgparent = element parent {hgparent.attlist, text}
+hgparent.attlist =
+    attribute revision {xsd:integer {minInclusive = "-1"} }
+  & attribute node {node.type}
+author = element author { author.attlist, text }
+author.attlist =
+    attribute email {text}
+date = element date {xsd:dateTime}
+msg = element msg {msg.attlist, text}
+msg.attlist =
+    attribute xml:space {"preserve"}
+paths = element paths { path* }
+path = element path { path.attlist, text }
+path.attlist =
+    # Action: (A)dd, (M)odify, (R)emove
+    attribute action {"A"|"M"|"R"}
+copies = element copies { copy+ }
+copy = element copy { copy.attlist, text }
+copy.attlist =
+    attribute source {text}
+extra = element extra {extra.attlist, text}
+extra.attlist =
+    attribute key {text}
--- a/mercurial/cmdutil.py	Wed Dec 30 20:59:23 2009 +0100
+++ b/mercurial/cmdutil.py	Wed Dec 30 14:32:37 2009 -0600
@@ -844,7 +844,7 @@
             self.ui.write(templater.stringify(self.t(key, **props)))
             self.showpatch(ctx.node())
 
-            if types['header']:
+            if types['footer']:
                 if not self.footer:
                     self.footer = templater.stringify(self.t(types['footer'],
                                                       **props))
--- a/mercurial/templates/map-cmdline.xml	Wed Dec 30 20:59:23 2009 +0100
+++ b/mercurial/templates/map-cmdline.xml	Wed Dec 30 14:32:37 2009 -0600
@@ -3,6 +3,7 @@
 
 changeset = '<logentry revision="{rev}" node="{node}">\n{branches}{tags}{parents}<author email="{author|email|xmlescape}">{author|person|xmlescape}</author>\n<date>{date|rfc3339date}</date>\n<msg xml:space="preserve">{desc|xmlescape}</msg>\n</logentry>\n'
 changeset_verbose = '<logentry revision="{rev}" node="{node}">\n{branches}{tags}{parents}<author email="{author|email|xmlescape}">{author|person|xmlescape}</author>\n<date>{date|rfc3339date}</date>\n<msg xml:space="preserve">{desc|xmlescape}</msg>\n<paths>\n{file_adds}{file_dels}{file_mods}</paths>\n{file_copies}</logentry>\n'
+changeset_debug = '<logentry revision="{rev}" node="{node}">\n{branches}{tags}{parents}<author email="{author|email|xmlescape}">{author|person|xmlescape}</author>\n<date>{date|rfc3339date}</date>\n<msg xml:space="preserve">{desc|xmlescape}</msg>\n<paths>\n{file_adds}{file_dels}{file_mods}</paths>\n{file_copies}{extras}</logentry>\n'
 
 file_add  = '<path action="A">{file_add|xmlescape}</path>\n'
 file_mod  = '<path action="M">{file_mod|xmlescape}</path>\n'
@@ -15,3 +16,4 @@
 parent = '<parent revision="{rev}" node="{node}" />\n'
 branch = '<branch>{branch|xmlescape}</branch>\n'
 tag = '<tag>{tag|xmlescape}</tag>\n'
+extra = '<extra key="{key|xmlescape}">{value|xmlescape}</extra>\n'
--- a/mercurial/windows.py	Wed Dec 30 20:59:23 2009 +0100
+++ b/mercurial/windows.py	Wed Dec 30 14:32:37 2009 -0600
@@ -203,7 +203,7 @@
         executable = findexisting(os.path.join(path, command))
         if executable is not None:
             return executable
-    return None
+    return findexisting(os.path.expanduser(os.path.expandvars(command)))
 
 def set_signal_handler():
     try:
--- a/tests/test-command-template	Wed Dec 30 20:59:23 2009 +0100
+++ b/tests/test-command-template	Wed Dec 30 14:32:37 2009 -0600
@@ -62,6 +62,14 @@
 hg log -v --style compact
 hg log --debug --style compact
 
+# Test xml styles
+echo '# xml style works (--style xml)'
+hg log --style xml
+echo '# xml style works (-v --style xml)'
+hg log -v --style xml
+echo '# xml style works (--debug --style xml)'
+hg log --debug --style xml
+
 echo '# error if style not readable'
 touch q
 chmod 0 q
--- a/tests/test-command-template.out	Wed Dec 30 20:59:23 2009 +0100
+++ b/tests/test-command-template.out	Wed Dec 30 14:32:37 2009 -0600
@@ -97,6 +97,266 @@
   line 1
 line 2
 
+# xml style works (--style xml)
+<?xml version="1.0"?>
+<log>
+<logentry revision="8" node="3bdecc1cde0c3d5fa6eaee3d9d9828f6ac468d57">
+<tag>tip</tag>
+<author email="test">test</author>
+<date>2020-01-01T10:01:00+00:00</date>
+<msg xml:space="preserve">third</msg>
+</logentry>
+<logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="user@hostname">User Name</author>
+<date>1970-01-12T13:46:40+00:00</date>
+<msg xml:space="preserve">second</msg>
+</logentry>
+<logentry revision="6" node="c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f">
+<parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
+<parent revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4" />
+<author email="person">person</author>
+<date>1970-01-18T08:40:01+00:00</date>
+<msg xml:space="preserve">merge</msg>
+</logentry>
+<logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
+<parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
+<author email="person">person</author>
+<date>1970-01-18T08:40:00+00:00</date>
+<msg xml:space="preserve">new head</msg>
+</logentry>
+<logentry revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4">
+<branch>foo</branch>
+<author email="person">person</author>
+<date>1970-01-17T04:53:20+00:00</date>
+<msg xml:space="preserve">new branch</msg>
+</logentry>
+<logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
+<author email="person">person</author>
+<date>1970-01-16T01:06:40+00:00</date>
+<msg xml:space="preserve">no user, no domain</msg>
+</logentry>
+<logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
+<author email="other@place">other</author>
+<date>1970-01-14T21:20:00+00:00</date>
+<msg xml:space="preserve">no person</msg>
+</logentry>
+<logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
+<author email="other@place">A. N. Other</author>
+<date>1970-01-13T17:33:20+00:00</date>
+<msg xml:space="preserve">other 1
+other 2
+
+other 3</msg>
+</logentry>
+<logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
+<author email="user@hostname">User Name</author>
+<date>1970-01-12T13:46:40+00:00</date>
+<msg xml:space="preserve">line 1
+line 2</msg>
+</logentry>
+</log>
+# xml style works (-v --style xml)
+<?xml version="1.0"?>
+<log>
+<logentry revision="8" node="3bdecc1cde0c3d5fa6eaee3d9d9828f6ac468d57">
+<tag>tip</tag>
+<author email="test">test</author>
+<date>2020-01-01T10:01:00+00:00</date>
+<msg xml:space="preserve">third</msg>
+<paths>
+<path action="A">fourth</path>
+<path action="A">third</path>
+<path action="R">second</path>
+</paths>
+<copies>
+<copy source="second">fourth</copy>
+</copies>
+</logentry>
+<logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="user@hostname">User Name</author>
+<date>1970-01-12T13:46:40+00:00</date>
+<msg xml:space="preserve">second</msg>
+<paths>
+<path action="A">second</path>
+</paths>
+</logentry>
+<logentry revision="6" node="c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f">
+<parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
+<parent revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4" />
+<author email="person">person</author>
+<date>1970-01-18T08:40:01+00:00</date>
+<msg xml:space="preserve">merge</msg>
+<paths>
+</paths>
+</logentry>
+<logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
+<parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
+<author email="person">person</author>
+<date>1970-01-18T08:40:00+00:00</date>
+<msg xml:space="preserve">new head</msg>
+<paths>
+<path action="A">d</path>
+</paths>
+</logentry>
+<logentry revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4">
+<branch>foo</branch>
+<author email="person">person</author>
+<date>1970-01-17T04:53:20+00:00</date>
+<msg xml:space="preserve">new branch</msg>
+<paths>
+</paths>
+</logentry>
+<logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
+<author email="person">person</author>
+<date>1970-01-16T01:06:40+00:00</date>
+<msg xml:space="preserve">no user, no domain</msg>
+<paths>
+<path action="M">c</path>
+</paths>
+</logentry>
+<logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
+<author email="other@place">other</author>
+<date>1970-01-14T21:20:00+00:00</date>
+<msg xml:space="preserve">no person</msg>
+<paths>
+<path action="A">c</path>
+</paths>
+</logentry>
+<logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
+<author email="other@place">A. N. Other</author>
+<date>1970-01-13T17:33:20+00:00</date>
+<msg xml:space="preserve">other 1
+other 2
+
+other 3</msg>
+<paths>
+<path action="A">b</path>
+</paths>
+</logentry>
+<logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
+<author email="user@hostname">User Name</author>
+<date>1970-01-12T13:46:40+00:00</date>
+<msg xml:space="preserve">line 1
+line 2</msg>
+<paths>
+<path action="A">a</path>
+</paths>
+</logentry>
+</log>
+# xml style works (--debug --style xml)
+<?xml version="1.0"?>
+<log>
+<logentry revision="8" node="3bdecc1cde0c3d5fa6eaee3d9d9828f6ac468d57">
+<tag>tip</tag>
+<parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="test">test</author>
+<date>2020-01-01T10:01:00+00:00</date>
+<msg xml:space="preserve">third</msg>
+<paths>
+<path action="A">fourth</path>
+<path action="A">third</path>
+<path action="R">second</path>
+</paths>
+<copies>
+<copy source="second">fourth</copy>
+</copies>
+<extra key="branch">default</extra>
+</logentry>
+<logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="user@hostname">User Name</author>
+<date>1970-01-12T13:46:40+00:00</date>
+<msg xml:space="preserve">second</msg>
+<paths>
+<path action="A">second</path>
+</paths>
+<extra key="branch">default</extra>
+</logentry>
+<logentry revision="6" node="c7b487c6c50ef1cf464cafdc4f4f5e615fc5999f">
+<parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
+<parent revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4" />
+<author email="person">person</author>
+<date>1970-01-18T08:40:01+00:00</date>
+<msg xml:space="preserve">merge</msg>
+<paths>
+</paths>
+<extra key="branch">default</extra>
+</logentry>
+<logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
+<parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="person">person</author>
+<date>1970-01-18T08:40:00+00:00</date>
+<msg xml:space="preserve">new head</msg>
+<paths>
+<path action="A">d</path>
+</paths>
+<extra key="branch">default</extra>
+</logentry>
+<logentry revision="4" node="32a18f097fcccf76ef282f62f8a85b3adf8d13c4">
+<branch>foo</branch>
+<parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="person">person</author>
+<date>1970-01-17T04:53:20+00:00</date>
+<msg xml:space="preserve">new branch</msg>
+<paths>
+</paths>
+<extra key="branch">foo</extra>
+</logentry>
+<logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
+<parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="person">person</author>
+<date>1970-01-16T01:06:40+00:00</date>
+<msg xml:space="preserve">no user, no domain</msg>
+<paths>
+<path action="M">c</path>
+</paths>
+<extra key="branch">default</extra>
+</logentry>
+<logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
+<parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="other@place">other</author>
+<date>1970-01-14T21:20:00+00:00</date>
+<msg xml:space="preserve">no person</msg>
+<paths>
+<path action="A">c</path>
+</paths>
+<extra key="branch">default</extra>
+</logentry>
+<logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
+<parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="other@place">A. N. Other</author>
+<date>1970-01-13T17:33:20+00:00</date>
+<msg xml:space="preserve">other 1
+other 2
+
+other 3</msg>
+<paths>
+<path action="A">b</path>
+</paths>
+<extra key="branch">default</extra>
+</logentry>
+<logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<parent revision="-1" node="0000000000000000000000000000000000000000" />
+<author email="user@hostname">User Name</author>
+<date>1970-01-12T13:46:40+00:00</date>
+<msg xml:space="preserve">line 1
+line 2</msg>
+<paths>
+<path action="A">a</path>
+</paths>
+<extra key="branch">default</extra>
+</logentry>
+</log>
 # error if style not readable
 abort: Permission denied: ./q
 # error if no style