From a553ef0b2bb31dd019d00d4cbceb656fb376808d Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 18 Mar 2020 23:12:01 +0100 Subject: [PATCH 1/2] fix 'can't add a new key into hash during iteration' error --- rcs-fast-export.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rcs-fast-export.rb b/rcs-fast-export.rb index 4128335..59d8a71 100755 --- a/rcs-fast-export.rb +++ b/rcs-fast-export.rb @@ -628,6 +628,11 @@ def RCS.parse(fname, rcsfile, opts={}) rcs.revision.each do |key, rev| if rev.date.nil? and not rev.symbols.empty? top = keys.select { |k| k.match(/^#{key}\./) }.sort.last + # assume it's all good if we can't find anything + if top == nil + branches << key + next + end tr = rcs.revision[top] raise "unhandled complex branch structure met: #{rev.inspect} refers #{tr.inspect}" if tr.date.nil? tr.branches |= rev.symbols From 30b9a99a996c168100e0b4c0691e376e293079fa Mon Sep 17 00:00:00 2001 From: Erik Hemming Date: Wed, 18 Mar 2020 23:13:50 +0100 Subject: [PATCH 2/2] support ignore case for the RCS dir --- rcs-fast-export.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rcs-fast-export.rb b/rcs-fast-export.rb index 59d8a71..15b1c8b 100755 --- a/rcs-fast-export.rb +++ b/rcs-fast-export.rb @@ -1003,8 +1003,8 @@ def steal_username filename = File.basename(rcsfile, SFX) path = File.dirname(rcsfile) # strip trailing "/RCS" if present, or "RCS" if that's - # the full path - path.sub!(/(^|#{File::SEPARATOR})RCS$/, '') + # the full path (case insensitive) + path.sub!(/(^|#{File::SEPARATOR})RCS$/i, '') # strip off the portion of the path specified # on the command line from the front of the path # (or delete the path completely if it is the same