Patchwork [2,of,3] push: specify default-push and default as fallback paths

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 26, 2015, 12:06 p.m.
Message ID <cfbbc41a45b1ddc0d2d4.1451131605@mimosa>
Download mbox | patch
Permalink /patch/12355/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 26, 2015, 12:06 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1451113948 -32400
#      Sat Dec 26 16:12:28 2015 +0900
# Node ID cfbbc41a45b1ddc0d2d44e655e6b1c124174228f
# Parent  38c6d17c94e16ed63f532730cb2992eb86dd9e6a
push: specify default-push and default as fallback paths

The next patch will remove the "default-push" hack from ui.paths so that
ui.paths["default"].pushurl can be different from "default-push".

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5660,7 +5660,7 @@  def push(ui, repo, dest=None, **opts):
                 # this lets simultaneous -r, -b options continue working
                 opts.setdefault('rev', []).append("null")
 
-    path = ui.paths.getpath(dest, default='default')
+    path = ui.paths.getpath(dest, default=('default-push', 'default'))
     if not path:
         raise error.Abort(_('default repository not configured!'),
                          hint=_('see the "path" section in "hg help config"'))