# HG changeset patch # User Marcin Kasperski # Date 1446970138 -3600 # Node ID bed42905e8718f6f56fbb92d6792adf8b011497b # Parent e702b63eea3faeab55db7f7ab52d8625321219cd Avoiding doing pull or push twice in case some path has more than one alias (like when both default and bitbucket are aliases to the same remote path) diff -r e702b63eea3f -r bed42905e871 allpaths.py --- a/allpaths.py Sun Nov 08 09:01:49 2015 +0100 +++ b/allpaths.py Sun Nov 08 09:08:58 2015 +0100 @@ -24,14 +24,21 @@ if not paths: raise mercurial.util.Abort(_('No paths defined in section %s') % group) - # Push! - for path in paths: - try: - command(ui, repo, path[1], **opts) - except Exception as e: - if not ignore_errors: - raise - ui.warn(_('error handling %s: %s') % (path[1], e)) + # Used to avoid handling duplicate paths twice + handled = {} + + # Act! + for alias, path in paths: + if path in handled: + ui.note(_("Skipping %s as it aliases already handled %s\n") % (alias, handled[path])) + else: + handled[path] = alias + try: + command(ui, repo, path, **opts) + except Exception as e: + if not ignore_errors: + raise + ui.warn(_('error handling %s: %s') % (path[1], e)) def pushall(ui, repo, **opts):