mercurial/dispatch.py
changeset 34312 0e48813cc106
parent 34146 0fa781320203
child 34313 bd50aa1aa035
--- a/mercurial/dispatch.py	Sun Sep 24 19:37:55 2017 +0530
+++ b/mercurial/dispatch.py	Sat Sep 23 13:31:09 2017 -0700
@@ -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):