##// END OF EJS Templates
Add -q option to import...
mpm@selenic.com -
r50:0263ce8b default
parent child Browse files
Show More
@@ -133,12 +133,15 b' elif cmd == "commit" or cmd == "checkin"'
133 elif cmd == "import" or cmd == "patch":
133 elif cmd == "import" or cmd == "patch":
134 ioptions = {}
134 ioptions = {}
135 opts = [('p', 'strip', 1, 'path strip'),
135 opts = [('p', 'strip', 1, 'path strip'),
136 ('b', 'base', "", 'base path')]
136 ('b', 'base', "", 'base path'),
137 ('q', 'quiet', "", 'silence diff')
138 ]
137
139
138 args = fancyopts.fancyopts(args, opts, ioptions,
140 args = fancyopts.fancyopts(args, opts, ioptions,
139 'hg import [options] <patch names>')
141 'hg import [options] <patch names>')
140 d = ioptions["base"]
142 d = ioptions["base"]
141 strip = ioptions["strip"]
143 strip = ioptions["strip"]
144 quiet = ioptions["quiet"] and "> /dev/null" or ""
142
145
143 for patch in args:
146 for patch in args:
144 ui.status("applying %s\n" % patch)
147 ui.status("applying %s\n" % patch)
@@ -149,7 +152,8 b' elif cmd == "import" or cmd == "patch":'
149 if l[:3] == "---": break
152 if l[:3] == "---": break
150 text += l
153 text += l
151
154
152 os.system("patch -p%d < %s > /dev/null" % (strip, pf))
155 if os.system("patch -p%d < %s %s" % (strip, pf, quiet)):
156 raise "patch failed!"
153 f = os.popen("lsdiff --strip %d %s" % (strip, pf))
157 f = os.popen("lsdiff --strip %d %s" % (strip, pf))
154 files = f.read().splitlines()
158 files = f.read().splitlines()
155 f.close()
159 f.close()
General Comments 0
You need to be logged in to leave comments. Login now