Create NameConflictTreeWalk to transparently detect D/F conflicts
commit8b631fd4a234cb18911950e4c4cc588d36ea3c56
authorShawn O. Pearce <spearce@spearce.org>
Mon, 18 Aug 2008 23:53:21 +0000 (18 16:53 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 20 Aug 2008 21:08:19 +0000 (20 23:08 +0200)
tree45493a8e65790f06b31796a93d2d1e122d6de3c8
parent219ce47ed7f356cd20bbba1c4c042ba1c8791ba1
Create NameConflictTreeWalk to transparently detect D/F conflicts

When performing a merge between two or more tree iterators we really
need to be able to detect a directory-file conflict and handle it as
a single step of the TreeWalk iteration.  This way we can merge say
three iterators together:

  - commit $A
  - commit $B
  - working tree

Where the working tree is moving from $A to $B and the file path
"foo" has been changed from being a file in $A to a directory in
commit $B.  To make this change effective we must delete "foo"
and then enter the "foo" subtree to create the directory and
the paths within it.

This walk implementation is outside of TreeWalk as it is not a
trivial operation.  Applications should only use this variant
when conflict handling is absolutely necessary.  Basic commit
filtering (such as done by RevWalk) does not need this support
so we really don't want to bog down RevWalk's critical loop.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/treewalk/AbstractTreeIterator.java
org.spearce.jgit/src/org/spearce/jgit/treewalk/NameConflictTreeWalk.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/treewalk/TreeWalk.java