Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
38c40ad3
Commit
38c40ad3
authored
Aug 18, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/patch_from_svn can generate diff from a SVN directory directly
Change-Id: I3abc602627575901d75fde42f73d73675522ee2a
parent
b0b02620
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
patch_from_svn
tools/patch_from_svn
+21
-5
No files found.
tools/patch_from_svn
View file @
38c40ad3
#!/bin/bash
if
[
-z
"
$1
"
]
;
then
echo
"Usage
: patch_from_svn some.patch
"
echo
"
The patch should be generated by 'svn diff -c <REV>'
"
echo
"Usage
1: patch_from_svn PATCHFILE (generated by 'svn diff -c REVISION')
"
echo
"
Usage2: patch_from_svn SVN_DIR REVISION
"
exit
1
fi
cat
$1
|sed
-e
's/src\/baidu\/rpc\//brpc\//g'
\
PATCHFILE
=
$1
if
[
-d
"
$1
/.svn"
]
;
then
if
[
-z
"
$2
"
]
;
then
echo
"Second argument must be a SVN revision"
exit
1
fi
SVN_DIR
=
$1
REV
=
$2
PATCHFILE
=
$REV
.patch
echo
"*** Generating diff of
$SVN_DIR
@
$REV
"
svn diff
$SVN_DIR
-c
$REV
>
$PATCHFILE
fi
MODIFIED_PATCHFILE
=
"
$(
basename
$PATCHFILE
)
.brpc_os"
cat
$PATCHFILE
|
sed
-e
's/src\/baidu\/rpc\//brpc\//g'
\
-e
's/\<baidu\/rpc\//brpc\//g'
\
-e
's/brpc\/test\/test_\(.*\)\.cpp/test\/brpc_\1_unittest.cpp/g'
\
-e
's/\<namespace \+baidu *{/namespace brpc {/g'
\
...
...
@@ -26,10 +41,11 @@ cat $1 |sed -e 's/src\/baidu\/rpc\//brpc\//g' \
-e
's/<\(base\/[^>]*\)>/"\1"/g'
\
-e
's/<\(bthread\/[^>]*\)>/"\1"/g'
\
-e
's/<\(mcpack2pb\/[^>]*\)>/"\1"/g'
\
>
$
1
.brpc_os
>
$
MODIFIED_PATCHFILE
EXTRA_ARGS
=
if
[
-z
"
$DO_RUN
"
]
;
then
EXTRA_ARGS
=
"--dry-run
$EXTRA_ARGS
"
echo
"*** This is a dry-run. To really apply, run: DO_RUN=1 tools/patch_from_svn
$1
"
fi
patch
-p0
-u
$EXTRA_ARGS
<
$1
.brpc_os
patch
-p0
-u
$EXTRA_ARGS
<
$MODIFIED_PATCHFILE
rm
$MODIFIED_PATCHFILE
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment