Patchwork D804: alias: test duplicated definition earlier

login
register
mail settings
Submitter phabricator
Date Sept. 25, 2017, 3:02 p.m.
Message ID <16fa6e86fd5685d618e7ff3380a7e8c4@localhost.localdomain>
Download mbox | patch
Permalink /patch/24140/
State Not Applicable
Headers show

Comments

phabricator - Sept. 25, 2017, 3:02 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0e48813cc106: alias: test duplicated definition earlier (authored by quark, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D804?vs=2051&id=2063

REVISION DETAIL
  https://phab.mercurial-scm.org/D804

AFFECTED FILES
  mercurial/dispatch.py

CHANGE DETAILS




To: quark, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -528,17 +528,15 @@ 
     # may use extension commands. Aliases can also use other alias definitions,
     # but only if they have been defined prior to the current definition.
     for alias, definition in ui.configitems('alias'):
-        source = ui.configsource('alias', alias)
-        aliasdef = cmdalias(alias, definition, cmdtable, source)
-
         try:
-            olddef = cmdtable[aliasdef.cmd][0]
-            if olddef.definition == aliasdef.definition:
+            if cmdtable[alias][0].definition == definition:
                 continue
         except (KeyError, AttributeError):
             # definition might not exist or it might not be a cmdalias
             pass
 
+        source = ui.configsource('alias', alias)
+        aliasdef = cmdalias(alias, definition, cmdtable, source)
         cmdtable[aliasdef.name] = (aliasdef, aliasdef.opts, aliasdef.help)
 
 def _parse(ui, args):