[PATCH] merge: detect conflict between added file and directory (issue29)

Matt Mackall mpm at selenic.com
Thu Oct 18 22:14:35 CDT 2012


On Wed, 2012-10-10 at 23:36 +0000, Evgeniy Makeev wrote:
> 
> On 10/10/12 3:16 PM, "Matt Mackall" <mpm at selenic.com> wrote:
> 
> >On Tue, 2012-10-09 at 14:21 -0700, Evgeniy Makeev wrote:
> >> # HG changeset patch
> >> # User Evgeniy Makeev <evgeniym at fb.com>
> >> # Date 1349739050 25200
> >> # Node ID 072243d45be07be438736f125baa6a2381dd53c4
> >> # Parent  3c775c5a6c03ed010ce2b85dd59968c63afc77b6
> >> merge: detect conflict between added file and directory (issue29)
> >> 
> >> The fix checks for conflicts between files being added by merge/update
> >>and
> >> local directories during manifest processing phase. If there is
> >> a conflict, user will be prompted to either abort the operation or skip
> >> adding the conflicting files if the conflicting local directory is not
> >> empty. If the conflicting local directory is empty, user will be
> >>prompted
> >> either to remove the empty directory or abort.
> >
> >I think this is a good start, but needs a lot of work still.
> >
> >First, this appears to only check for collisions in one direction. What
> >about going the other way?
> 
> There is another patch checking the other direction collisions, I emailed
> it yesterday as well (header below).

To stay above water, I must delete any and all superfluous mail (for
instance, patches that looks like duplicates) with as little inspection
as possible.

> Did you have chance to look at it? Should I combine both patches in one?

You should at least make it clear they're part of a series, not resends.

> # HG changeset patch
> # User Evgeniy Makeev <evgeniym at fb.com>
> # Date 1349754802 25200
> # Node ID 227411b21482b7ee80a85628989957716eb3659b
> # Parent  072243d45be07be438736f125baa6a2381dd53c4
> merge: detect conflict between path of added file and a local file
> (issue29)
> 
> The fix checks for conflicts between local files and directories being
> merged/added, if there is a conflict, user is prompted to abbort or
> skip merging/adding all files wich have the conflicting directories
> in their paths. The check is done by building a directory set off all
> partial paths of added files.
> 
> diff -r 072243d45be0 -r 227411b21482 mercurial/merge.py
> ...
> 
> >
> >> +                if os.path.isdir(dirpath):
> >
> >Poking at the filesystem with an extra syscall for each new remote file
> >is not a good idea. Especially on systems like OS X and Windows which
> >have really bad file lookup performance and syscall overhead.
> 
> Would satisfying 'if f in p1.dirs()' condition first instead if
> os.path.isdir be better? There won't be a syscall in non collision cases,
> but there will be an overhead of building all dirs set.

Yes. The set is cached.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list