[PATCH rfc] merge: record file removal when selecting "leave deleted"

Thomas Arendsen Hein thomas at intevation.de
Mon Jul 23 10:02:13 CDT 2012


* Matt Mackall <mpm at selenic.com> [20120714 01:54]:
> On Fri, 2012-06-29 at 11:02 +0200, Thomas Arendsen Hein wrote:
> > # HG changeset patch
> > # User Thomas Arendsen Hein <thomas at intevation.de>
> > # Date 1340896042 -7200
> > # Node ID 1d793d776d6f9f06646f9893a750641b09ad6fba
> > # Parent  fba17a64fa4978bfea19222da5e64a18cfddeecd
> > merge: record file removal when selecting "leave deleted"
> > 
> >  "local changed %s which remote deleted
> >   use (c)hanged version or (d)elete?"
> > 
> > already records the deleted file in the changeset, so this changeset will be
> > listed with "hg log --removed file". If merging in the opposite direction,
> > the prompt will be:
> > 
> >  "remote changed %s which local deleted
> >   use (c)hanged version or leave (d)eleted?"
> > 
> > In this case no explicit remove happened, so the merge decision is not easy
> > to see.
> 
> Agreed that we should have symmetry here. But it's counter-intuitive to
> me that we should record a _second_ deletion, so I think it's actually
> the other case that's doing it wrong.
> 
> Like it or not, the invariant for listing in changelog files for merges
> has always been: if it's not added/changed/deleted relative to BOTH
> parents, it's not listed.

OK, so there are some things to change in the current implementation:
- do not add file to changelog if chosing "(d)elete" for the prompt
  "local changed %s which remote deleted" and then committing.
- do not add file to changelog if chosing "(c)hanged" for the prompt
  "remote changed %s which local deleted", then doing "hg rm -f
  file" and then committing.

And the feature request would be to provide a way for the user to
find out what happened during a merge. Currently only manually
comparing the manifests or using two hg status calls (one with --rev
'p1(foo):foo' and one with --rev 'p2(foo):foo') can show which files
were removed.

Should hg log --removed (and the removes() revset) be extended to
handle this situation?

Additionally I do not remember that I saw above invariant documented
anywhere, and I sometimes heared the question which files are being
listed in the "files:" entry of merge changesets.
What would be a good place? A verbose container in the help of hg log?

Regards,
Thomas

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Neuer Graben 17, 49074 Osnabrueck - AG Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the Mercurial-devel mailing list