Patchwork [1,of,3,RFC] import: document --exact behavior in more detail

login
register
mail settings
Submitter Augie Fackler
Date March 11, 2016, 6:25 p.m.
Message ID <288dbf95fd9eb74148d0.1457720748@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/13806/
State Accepted
Headers show

Comments

Augie Fackler - March 11, 2016, 6:25 p.m.
# HG changeset patch
# User Matt Mackall <mpm@selenic.com>
# Date 1457538453 18000
#      Wed Mar 09 10:47:33 2016 -0500
# Node ID 288dbf95fd9eb74148d0d94f0b7a05a4d3d7b50d
# Parent  8199ae50cd4b8bd89bf3d9b836ee10b9e49ba759
# EXP-Topic import
import: document --exact behavior in more detail
timeless - March 11, 2016, 9:03 p.m.
On Fri, Mar 11, 2016 at 1:25 PM, Augie Fackler <raf@durin42.com> wrote:
> + _('abort if patch would apply lossily')),

I'm wondering if we could use:
abort if hunks of the patch would be lost or corrupted

(Sorry, I did try to think of things earlier but didn't come up with any)
Augie Fackler - March 11, 2016, 9:10 p.m.
On Fri, Mar 11, 2016 at 4:03 PM, timeless <timeless@gmail.com> wrote:
>
> On Fri, Mar 11, 2016 at 1:25 PM, Augie Fackler <raf@durin42.com> wrote:
>> + _('abort if patch would apply lossily')),
>
> I'm wondering if we could use:
> abort if hunks of the patch would be lost or corrupted
>
> (Sorry, I did try to think of things earlier but didn't come up with any)


It's not just hunks though. It could be that the exported changeset
had a rebase_source in extra which doesn't get encoded in the exported
change.
timeless - March 11, 2016, 9:26 p.m.
Ah, right.
On Mar 11, 2016 4:10 PM, "Augie Fackler" <raf@durin42.com> wrote:

> On Fri, Mar 11, 2016 at 4:03 PM, timeless <timeless@gmail.com> wrote:
> >
> > On Fri, Mar 11, 2016 at 1:25 PM, Augie Fackler <raf@durin42.com> wrote:
> >> + _('abort if patch would apply lossily')),
> >
> > I'm wondering if we could use:
> > abort if hunks of the patch would be lost or corrupted
> >
> > (Sorry, I did try to think of things earlier but didn't come up with any)
>
>
> It's not just hunks though. It could be that the exported changeset
> had a rebase_source in extra which doesn't get encoded in the exported
> change.
>
Matt Mackall - April 12, 2016, 11:33 p.m.
On Fri, 2016-03-11 at 13:25 -0500, Augie Fackler wrote:
> # HG changeset patch
> # User Matt Mackall <mpm@selenic.com>
> # Date 1457538453 18000
> #      Wed Mar 09 10:47:33 2016 -0500
> # Node ID 288dbf95fd9eb74148d0d94f0b7a05a4d3d7b50d
> # Parent  8199ae50cd4b8bd89bf3d9b836ee10b9e49ba759
> # EXP-Topic import
> import: document --exact behavior in more detail

I'm taking your reposting of my patch as an implicit LGTM and queuing it for
default to ratchet this forward. 

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4682,7 +4682,7 @@  def identify(ui, repo, source=None, rev=
     ('', 'partial', None,
      _('commit even if some hunks fail')),
     ('', 'exact', None,
-     _('apply patch to the nodes from which it was generated')),
+     _('abort if patch would apply lossily')),
     ('', 'prefix', '',
      _('apply patch to subdirectory'), _('DIR')),
     ('', 'import-branch', None,
@@ -4722,8 +4722,9 @@  def import_(ui, repo, patch1=None, *patc
     If --exact is specified, import will set the working directory to
     the parent of each patch before applying it, and will abort if the
     resulting changeset has a different ID than the one recorded in
-    the patch. This may happen due to character set problems or other
-    deficiencies in the text patch format.
+    the patch. This will guard against various ways that portable
+    patch formats and mail systems might fail to transfer Mercurial
+    data or metadata. See ':hg: bundle' for lossless transmission.
 
     Use --partial to ensure a changeset will be created from the patch
     even if some hunks fail to apply. Hunks that fail to apply will be