Show More
@@ -136,6 +136,12 b' elif cmd == "commit" or cmd == "checkin"' | |||||
136 | repo.commit(repo.current) |
|
136 | repo.commit(repo.current) | |
137 |
|
137 | |||
138 | elif cmd == "import" or cmd == "patch": |
|
138 | elif cmd == "import" or cmd == "patch": | |
|
139 | try: | |||
|
140 | import psyco | |||
|
141 | psyco.full() | |||
|
142 | except: | |||
|
143 | pass | |||
|
144 | ||||
139 | ioptions = {} |
|
145 | ioptions = {} | |
140 | opts = [('p', 'strip', 1, 'path strip'), |
|
146 | opts = [('p', 'strip', 1, 'path strip'), | |
141 | ('b', 'base', "", 'base path'), |
|
147 | ('b', 'base', "", 'base path'), | |
@@ -154,14 +160,16 b' elif cmd == "import" or cmd == "patch":' | |||||
154 |
|
160 | |||
155 | text = "" |
|
161 | text = "" | |
156 | for l in file(pf): |
|
162 | for l in file(pf): | |
157 |
if l[: |
|
163 | if l[:4] == "--- ": break | |
158 | text += l |
|
164 | text += l | |
159 |
|
165 | |||
160 | if os.system("patch -p%d < %s %s" % (strip, pf, quiet)): |
|
|||
161 | raise "patch failed!" |
|
|||
162 | f = os.popen("lsdiff --strip %d %s" % (strip, pf)) |
|
166 | f = os.popen("lsdiff --strip %d %s" % (strip, pf)) | |
163 | files = filter(None, map(lambda x: x.rstrip(), f.read().splitlines())) |
|
167 | files = filter(None, map(lambda x: x.rstrip(), f.read().splitlines())) | |
164 | f.close() |
|
168 | f.close() | |
|
169 | ||||
|
170 | if files: | |||
|
171 | if os.system("patch -p%d < %s %s" % (strip, pf, quiet)): | |||
|
172 | raise "patch failed!" | |||
165 | repo.commit(repo.current, files, text) |
|
173 | repo.commit(repo.current, files, text) | |
166 |
|
174 | |||
167 | elif cmd == "status": |
|
175 | elif cmd == "status": |
General Comments 0
You need to be logged in to leave comments.
Login now