From 6ca7e36b5ddba1a0ceccfb715bad02484776a720 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 20 Sep 2012 18:22:30 +0200 Subject: [PATCH] Fix branch handling The script assumed that when the branches keyword had arguments, these were in subsequent lines; however, this is not always the case: we can also have branches somebranch; Fix this by catching any lines _starting_ with 'branches ' rather than just matching the word. This must be done after skipping over empty branches line, and by re-processing the line after stripping the initial 'branches ' part so that the :branches action processing only finds the actual branch. --- rcs-fast-export.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rcs-fast-export.rb b/rcs-fast-export.rb index ea64118..9f9b33d 100755 --- a/rcs-fast-export.rb +++ b/rcs-fast-export.rb @@ -364,10 +364,14 @@ module RCS rcs.revision[rev].date = $1 rcs.revision[rev].author = $2 rcs.revision[rev].state = $3 - when 'branches' - status.push :branches - when /branches\s*;/ + when /^branches\s*;/ next + when /^branches\s+/ + status.push :branches + if line.index(';') + line = line.sub(/^branches\s+/,'') + redo + end when /^next\s+(\S+)?;$/ nxt = rcs.revision[rev].next = $1 next unless nxt -- 2.32.0.93.g670b81a890