mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
merge with stable
This commit is contained in:
commit
989dda555a
@ -150,6 +150,13 @@ class zipit(object):
|
||||
self.z = zipfile.ZipFile(dest, 'w',
|
||||
compress and zipfile.ZIP_DEFLATED or
|
||||
zipfile.ZIP_STORED)
|
||||
|
||||
# Python's zipfile module emits deprecation warnings if we try
|
||||
# to store files with a date before 1980.
|
||||
epoch = 315532800 # calendar.timegm((1980, 1, 1, 0, 0, 0, 1, 1, 0))
|
||||
if mtime < epoch:
|
||||
mtime = epoch
|
||||
|
||||
self.date_time = time.gmtime(mtime)[:6]
|
||||
|
||||
def addfile(self, name, mode, islink, data):
|
||||
|
@ -276,7 +276,10 @@ def keyword(repo, subset, x):
|
||||
return l
|
||||
|
||||
def grep(repo, subset, x):
|
||||
gr = re.compile(getstring(x, _("grep wants a string")))
|
||||
try:
|
||||
gr = re.compile(getstring(x, _("grep wants a string")))
|
||||
except re.error, e:
|
||||
raise error.ParseError(_('invalid match pattern: %s') % e)
|
||||
l = []
|
||||
for r in subset:
|
||||
c = repo[r]
|
||||
|
@ -219,5 +219,19 @@ empty repo
|
||||
$ hg archive ../test-empty
|
||||
abort: no working directory: please specify a revision
|
||||
[255]
|
||||
old file -- date clamped to 1980
|
||||
|
||||
$ touch -d 1975-01-01 old
|
||||
$ hg add old
|
||||
$ hg commit -m old
|
||||
$ hg archive ../old.zip
|
||||
$ unzip -l ../old.zip
|
||||
Archive: ../old.zip
|
||||
Length Date Time Name
|
||||
--------- ---------- ----- ----
|
||||
147 1980-01-01 00:00 old/.hg_archival.txt
|
||||
0 1980-01-01 00:00 old/old
|
||||
--------- -------
|
||||
147 2 files
|
||||
|
||||
$ exit 0
|
||||
|
@ -211,6 +211,10 @@ quoting needed
|
||||
9
|
||||
$ log 'grep("issue\d+")'
|
||||
6
|
||||
$ try 'grep("(")' # invalid regular expression
|
||||
('func', ('symbol', 'grep'), ('string', '('))
|
||||
hg: parse error: invalid match pattern: unbalanced parenthesis
|
||||
[255]
|
||||
$ log 'head()'
|
||||
0
|
||||
1
|
||||
|
Loading…
Reference in New Issue
Block a user