##// END OF EJS Templates
merge with stable
Martin Geisler -
r12321:11db6fa2 merge default
parent child Browse files
Show More
@@ -150,6 +150,13 b' class zipit(object):'
150 self.z = zipfile.ZipFile(dest, 'w',
150 self.z = zipfile.ZipFile(dest, 'w',
151 compress and zipfile.ZIP_DEFLATED or
151 compress and zipfile.ZIP_DEFLATED or
152 zipfile.ZIP_STORED)
152 zipfile.ZIP_STORED)
153
154 # Python's zipfile module emits deprecation warnings if we try
155 # to store files with a date before 1980.
156 epoch = 315532800 # calendar.timegm((1980, 1, 1, 0, 0, 0, 1, 1, 0))
157 if mtime < epoch:
158 mtime = epoch
159
153 self.date_time = time.gmtime(mtime)[:6]
160 self.date_time = time.gmtime(mtime)[:6]
154
161
155 def addfile(self, name, mode, islink, data):
162 def addfile(self, name, mode, islink, data):
@@ -276,7 +276,10 b' def keyword(repo, subset, x):'
276 return l
276 return l
277
277
278 def grep(repo, subset, x):
278 def grep(repo, subset, x):
279 gr = re.compile(getstring(x, _("grep wants a string")))
279 try:
280 gr = re.compile(getstring(x, _("grep wants a string")))
281 except re.error, e:
282 raise error.ParseError(_('invalid match pattern: %s') % e)
280 l = []
283 l = []
281 for r in subset:
284 for r in subset:
282 c = repo[r]
285 c = repo[r]
@@ -219,5 +219,19 b' empty repo'
219 $ hg archive ../test-empty
219 $ hg archive ../test-empty
220 abort: no working directory: please specify a revision
220 abort: no working directory: please specify a revision
221 [255]
221 [255]
222 old file -- date clamped to 1980
223
224 $ touch -d 1975-01-01 old
225 $ hg add old
226 $ hg commit -m old
227 $ hg archive ../old.zip
228 $ unzip -l ../old.zip
229 Archive: ../old.zip
230 Length Date Time Name
231 --------- ---------- ----- ----
232 147 1980-01-01 00:00 old/.hg_archival.txt
233 0 1980-01-01 00:00 old/old
234 --------- -------
235 147 2 files
222
236
223 $ exit 0
237 $ exit 0
@@ -211,6 +211,10 b' quoting needed'
211 9
211 9
212 $ log 'grep("issue\d+")'
212 $ log 'grep("issue\d+")'
213 6
213 6
214 $ try 'grep("(")' # invalid regular expression
215 ('func', ('symbol', 'grep'), ('string', '('))
216 hg: parse error: invalid match pattern: unbalanced parenthesis
217 [255]
214 $ log 'head()'
218 $ log 'head()'
215 0
219 0
216 1
220 1
General Comments 0
You need to be logged in to leave comments. Login now