[PATCH 3 of 5] import: join base with patchurl *after* checking for stdin

Greg Ward greg-hg at gerg.ca
Sun Oct 2 13:37:32 CDT 2011


# HG changeset patch
# User Greg Ward <greg at gerg.ca>
# Date 1317520285 14400
# Node ID 402b3a0d2c1e27e2e08878d14a0b7d71edf0d486
# Parent  fdb3ef969f2ec1f3f8fac73caf5bbcf40f48f830
import: join base with patchurl *after* checking for stdin

This only matters when using the deprecated --base option, and
combining --base with a patch on stdin makes no sense. But it's such
an obvious bug and easy fix that I couldn't pass it by.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3371,11 +3371,11 @@
         lock = repo.lock()
         parents = repo.parents()
         for patchurl in patches:
-            patchurl = os.path.join(base, patchurl)
             if patchurl == '-':
                 ui.status(_('applying patch from stdin\n'))
                 patchfile = ui.fin
             else:
+                patchurl = os.path.join(base, patchurl)
                 ui.status(_('applying %s\n') % patchurl)
                 patchfile = url.open(ui, patchurl)
 


More information about the Mercurial-devel mailing list