Things that could be better for GUIs

Dirkjan Ochtman dirkjan at ochtman.nl
Sat Feb 28 06:07:28 CST 2009


On 28/02/2009 11:40, Bastian Doetsch wrote:
> Generally, I'm quite content how interfacing Mercurial works. There are
> some issues though:

Ah, I guess that you have different needs than THG/PIDA/CHG, since you 
call us from the command line. Good to keep that in mind.

> - - Authentication is a problem: Mercurial switches automatically to
> non-interactive mode when not called in a terminal. Rather unfortunate
> for hg sign, repository authentication and so on. Possible solution:
> Provide means to pass user and password via command line.

Would it be helpful if we added an --interactive global option that 
keeps it from going into non-interactive mode?

> - - When calling the Mercurial executable, big repositories get a huge
> performance penality, as text transformation has to be done in Mercurial
> (templates/styles) and in the calling program, as it needs to parse all
> that information.

Hmmm... Where is this an issue? log might be worst here, but I guess you 
could do incremental log; I don't suppose you'd need all 7000 csets at 
once, or do you?

> - - Mercurial doesn't provide progress indications.

This is something astratto has been working on, so at least it should be 
getting better in the future, hopefully.

> - - It's hard to determine, which options/commands are available
> (parsing hg help is no fun...)

I came up with this quick hack:

diff -r e5627562b9f2 mercurial/commands.py
--- a/mercurial/commands.py     Tue Feb 24 18:09:16 2009 +0100
+++ b/mercurial/commands.py     Sat Feb 28 12:54:04 2009 +0100
@@ -686,6 +686,12 @@
      a = r.ancestor(lookup(rev1), lookup(rev2))
      ui.write("%d:%s\n" % (r.rev(a), hex(a)))

+def debugcommands(ui, repo, *args):
+    for cmd, vals in util.sort(table.iteritems()):
+        cmd = cmd.split('|')[0].strip('^')
+        opts = ', '.join([i[1] for i in vals[1]])
+        ui.write('%s: %s\n' % (cmd, opts))
+
  def debugcomplete(ui, cmd='', **opts):
      """returns the completion list associated with the given command"""

@@ -3129,6 +3135,7 @@
           _('[OPTION]... [SOURCE]... DEST')),
      "debugancestor": (debugancestor, [], _('[INDEX] REV1 REV2')),
      "debugcheckstate": (debugcheckstate, []),
+    "debugcommands": (debugcommands, []),
      "debugcomplete":
          (debugcomplete,
           [('o', 'options', None, _('show the command options'))],

I hope that would be acceptable for inclusion. Matt?

> - - Rename tracking is not available in hg cat (if I find time to learn
> enough python, I'll fix it myself).

I can't really say anything about this, sorry.

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list