https://svn.lrde.epita.fr/svn/lrdetools/trunk
Index: ChangeLog
from Nicolas Pouillard <ertai(a)lrde.epita.fr>
Fix vcs *conflicts.
* vcs/lib/vcs/conflict.rb: Use the block based status.
conflict.rb | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
Index: vcs/lib/vcs/conflict.rb
--- vcs/lib/vcs/conflict.rb (revision 273)
+++ vcs/lib/vcs/conflict.rb (working copy)
@@ -5,19 +5,22 @@
class Vcs
- def mk_conflicts_list ( files, options={} )
- ls = status.output.readlines.grep(/^C/).map! { |s| s[/^C\s+(.*)/, 1] }
- raise "no conflicts" if ls.empty?
- ls
+ def mk_conflicts_list ( files=[], options={} )
+ conflicts = []
+ status(files, options) do |se|
+ conflicts << se.file if se.category == :conflict
+ end
+ raise "no conflicts" if conflicts.empty?
+ conflicts
end
protected :mk_conflicts_list
- def edit_conflicts! ( files, options={} )
- edit! mk_conflicts_list
+ def edit_conflicts! ( files=[], options={} )
+ edit! mk_conflicts_list(files, options)
end
- def resolve_conflicts! ( files, options={} )
- conflicts = mk_conflicts_list
+ def resolve_conflicts! ( files=[], options={} )
+ conflicts = mk_conflicts_list(files, options)
question = "Resolve these conflicts?: \n - #{conflicts.join("\n -
")}\n(y/n)"
if @h.agree question, true
return resolved(conflicts)