diff --git a/eden/scm/edenscm/mercurial/help.py b/eden/scm/edenscm/mercurial/help.py index b06fb69b5b..e0fcf49c79 100644 --- a/eden/scm/edenscm/mercurial/help.py +++ b/eden/scm/edenscm/mercurial/help.py @@ -833,6 +833,11 @@ def formattedhelp(ui, commands, name, keep=None, unknowncmd=False, full=True, ** Either returns the rendered help text or raises an exception. """ + for cmd in pycompat.iterkeys(commands.table): + rustdoc = getattr(commands.table[cmd][0], "__rusthelp__", None) + if rustdoc: + commands.table[cmd] = rustdoc + if keep is None: keep = [] else: diff --git a/eden/scm/edenscm/mercurial/registrar.py b/eden/scm/edenscm/mercurial/registrar.py index 9921e6345b..b8c9231c18 100644 --- a/eden/scm/edenscm/mercurial/registrar.py +++ b/eden/scm/edenscm/mercurial/registrar.py @@ -212,6 +212,14 @@ class command(_funcregistrarbase): func.subcommands = {} func.subcommandcategories = [] func.subonly = subonly + + if name in self._table: + # If the command already was in the table it is because it was an existing Rust command. + # We should keep and show the documentation for the Rust command. Since some Rust commands still + # fall back into the Python command in some scenarios, we cannot entirely keep the Rust function + prevfunc, *helpargs = self._table[name] + func.__rusthelp__ = pycompat.getdoc(prevfunc), *helpargs + if synopsis: self._table[name] = func, list(options), synopsis else: diff --git a/eden/scm/tests/test-alias.t b/eden/scm/tests/test-alias.t index c19d9ce994..033440e78c 100644 --- a/eden/scm/tests/test-alias.t +++ b/eden/scm/tests/test-alias.t @@ -203,21 +203,22 @@ invalid options Options ([+] can be repeated): - -A --all show status of all files - -m --modified show only modified files - -a --added show only added files - -r --removed show only removed files - -d --deleted show only deleted (but tracked) files - -c --clean show only files without changes - -u --unknown show only unknown (not tracked) files - -i --ignored show only ignored files - -n --no-status hide status prefix - -C --copies show source of copied files - -0 --print0 end filenames with NUL, for use with xargs - --rev REV [+] show difference from revision - --change REV list the changed files of a revision - -I --include PATTERN [+] include names matching the given patterns - -X --exclude PATTERN [+] exclude names matching the given patterns + -A --all show status of all files + -m --modified show only modified files + -a --added show only added files + -r --removed show only removed files + -d --deleted show only deleted (but tracked) files + -c --clean show only files without changes + -u --unknown show only unknown (not tracked) files + -i --ignored show only ignored files + -n --no-status hide status prefix + -C --copies show source of copied files + -0 --print0 end filenames with NUL, for use with xargs + --rev VALUE [+] show difference from revision + --change VALUE list the changed files of a revision + --root-relative show status relative to root + -I --include VALUE [+] include names matching the given patterns + -X --exclude VALUE [+] exclude names matching the given patterns (some details hidden, use --verbose to show complete help) $ hg no-R @@ -272,21 +273,22 @@ invalid options Options ([+] can be repeated): - -A --all show status of all files - -m --modified show only modified files - -a --added show only added files - -r --removed show only removed files - -d --deleted show only deleted (but tracked) files - -c --clean show only files without changes - -u --unknown show only unknown (not tracked) files - -i --ignored show only ignored files - -n --no-status hide status prefix - -C --copies show source of copied files - -0 --print0 end filenames with NUL, for use with xargs - --rev REV [+] show difference from revision - --change REV list the changed files of a revision - -I --include PATTERN [+] include names matching the given patterns - -X --exclude PATTERN [+] exclude names matching the given patterns + -A --all show status of all files + -m --modified show only modified files + -a --added show only added files + -r --removed show only removed files + -d --deleted show only deleted (but tracked) files + -c --clean show only files without changes + -u --unknown show only unknown (not tracked) files + -i --ignored show only ignored files + -n --no-status hide status prefix + -C --copies show source of copied files + -0 --print0 end filenames with NUL, for use with xargs + --rev VALUE [+] show difference from revision + --change VALUE list the changed files of a revision + --root-relative show status relative to root + -I --include VALUE [+] include names matching the given patterns + -X --exclude VALUE [+] exclude names matching the given patterns (some details hidden, use --verbose to show complete help) $ hg no--repo @@ -341,21 +343,22 @@ invalid options Options ([+] can be repeated): - -A --all show status of all files - -m --modified show only modified files - -a --added show only added files - -r --removed show only removed files - -d --deleted show only deleted (but tracked) files - -c --clean show only files without changes - -u --unknown show only unknown (not tracked) files - -i --ignored show only ignored files - -n --no-status hide status prefix - -C --copies show source of copied files - -0 --print0 end filenames with NUL, for use with xargs - --rev REV [+] show difference from revision - --change REV list the changed files of a revision - -I --include PATTERN [+] include names matching the given patterns - -X --exclude PATTERN [+] exclude names matching the given patterns + -A --all show status of all files + -m --modified show only modified files + -a --added show only added files + -r --removed show only removed files + -d --deleted show only deleted (but tracked) files + -c --clean show only files without changes + -u --unknown show only unknown (not tracked) files + -i --ignored show only ignored files + -n --no-status hide status prefix + -C --copies show source of copied files + -0 --print0 end filenames with NUL, for use with xargs + --rev VALUE [+] show difference from revision + --change VALUE list the changed files of a revision + --root-relative show status relative to root + -I --include VALUE [+] include names matching the given patterns + -X --exclude VALUE [+] exclude names matching the given patterns (some details hidden, use --verbose to show complete help) $ hg no--repository @@ -410,21 +413,22 @@ invalid options Options ([+] can be repeated): - -A --all show status of all files - -m --modified show only modified files - -a --added show only added files - -r --removed show only removed files - -d --deleted show only deleted (but tracked) files - -c --clean show only files without changes - -u --unknown show only unknown (not tracked) files - -i --ignored show only ignored files - -n --no-status hide status prefix - -C --copies show source of copied files - -0 --print0 end filenames with NUL, for use with xargs - --rev REV [+] show difference from revision - --change REV list the changed files of a revision - -I --include PATTERN [+] include names matching the given patterns - -X --exclude PATTERN [+] exclude names matching the given patterns + -A --all show status of all files + -m --modified show only modified files + -a --added show only added files + -r --removed show only removed files + -d --deleted show only deleted (but tracked) files + -c --clean show only files without changes + -u --unknown show only unknown (not tracked) files + -i --ignored show only ignored files + -n --no-status hide status prefix + -C --copies show source of copied files + -0 --print0 end filenames with NUL, for use with xargs + --rev VALUE [+] show difference from revision + --change VALUE list the changed files of a revision + --root-relative show status relative to root + -I --include VALUE [+] include names matching the given patterns + -X --exclude VALUE [+] exclude names matching the given patterns (some details hidden, use --verbose to show complete help) $ hg no--config diff --git a/eden/scm/tests/test-help.t b/eden/scm/tests/test-help.t index 3a36006c5a..67dcf148b1 100644 --- a/eden/scm/tests/test-help.t +++ b/eden/scm/tests/test-help.t @@ -667,21 +667,22 @@ Test command without options Options ([+] can be repeated): - -A --all show status of all files - -m --modified show only modified files - -a --added show only added files - -r --removed show only removed files - -d --deleted show only deleted (but tracked) files - -c --clean show only files without changes - -u --unknown show only unknown (not tracked) files - -i --ignored show only ignored files - -n --no-status hide status prefix - -C --copies show source of copied files - -0 --print0 end filenames with NUL, for use with xargs - --rev REV [+] show difference from revision - --change REV list the changed files of a revision - -I --include PATTERN [+] include names matching the given patterns - -X --exclude PATTERN [+] exclude names matching the given patterns + -A --all show status of all files + -m --modified show only modified files + -a --added show only added files + -r --removed show only removed files + -d --deleted show only deleted (but tracked) files + -c --clean show only files without changes + -u --unknown show only unknown (not tracked) files + -i --ignored show only ignored files + -n --no-status hide status prefix + -C --copies show source of copied files + -0 --print0 end filenames with NUL, for use with xargs + --rev VALUE [+] show difference from revision + --change VALUE list the changed files of a revision + --root-relative show status relative to root + -I --include VALUE [+] include names matching the given patterns + -X --exclude VALUE [+] exclude names matching the given patterns (some details hidden, use --verbose to show complete help)