Fix svn status parsing for paths with extra status flags#174
Open
mostafasoufi wants to merge 1 commit into10up:developfrom
Open
Fix svn status parsing for paths with extra status flags#174mostafasoufi wants to merge 1 commit into10up:developfrom
mostafasoufi wants to merge 1 commit into10up:developfrom
Conversation
The sed regex `s/! *//` stops stripping at non-space characters in columns 2-7 of svn status output (e.g. lock flag 'L'), leaving invalid path prefixes like "L trunk/views/...". Replace with `cut -c9-` which correctly strips the fixed 8-character status prefix (7 status columns + 1 space) regardless of flag values. Fixes 10up#134
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
sed 's/! *//'regex on line 204 ofdeploy.shwhich fails to correctly parsesvn statusoutput when columns 2-7 contain non-space status flags (e.g.Lfor locked).Root cause:
svn statusoutput uses 7 fixed-width single-character columns followed by a space before the path. The currentsedregex strips!plus trailing spaces, but stops at any non-space character in columns 2-7, producing invalid paths likeL trunk/views/....Fix: Replace
sed 's/! *//'withcut -c9-which extracts from character 9 onward — always the start of the path regardless of status flags.Details
svn statusformat (docs):The
sedapproach works in the common case (columns 2-7 are spaces), but breaks when any flag is set — such asL(locked) which can appear during checkout operations in CI.Real-world failure: This caused
svn: E155007errors when deploying WP SMS v7.2 which added a newviews/directory tree. The locked entries duringsvn addleftLflags that corrupted the subsequentsvn rmpaths.Verification
cut -c9-produces identical output tosed 's/! *//'when columns 2-7 are all spaces (the common case)cut -c9-correctly handles all status flag combinations (locked, switched, conflicted, etc.)Fixes #134