Show More
@@ -35,6 +35,10 b' import os, sys, re, errno' | |||||
35 |
|
35 | |||
36 | commands.norepo += " qclone qversion" |
|
36 | commands.norepo += " qclone qversion" | |
37 |
|
37 | |||
|
38 | # Patch names looks like unix-file names. | |||
|
39 | # They must be joinable with queue directory and result in the patch path. | |||
|
40 | normname = util.normpath | |||
|
41 | ||||
38 | class statusentry: |
|
42 | class statusentry: | |
39 | def __init__(self, rev, name=None): |
|
43 | def __init__(self, rev, name=None): | |
40 | if not name: |
|
44 | if not name: | |
@@ -1335,7 +1339,7 b' class queue:' | |||||
1335 | lastparent = p1 |
|
1339 | lastparent = p1 | |
1336 |
|
1340 | |||
1337 | if not patchname: |
|
1341 | if not patchname: | |
1338 | patchname = '%d.diff' % r |
|
1342 | patchname = normname('%d.diff' % r) | |
1339 | checkseries(patchname) |
|
1343 | checkseries(patchname) | |
1340 | checkfile(patchname) |
|
1344 | checkfile(patchname) | |
1341 | self.full_series.insert(0, patchname) |
|
1345 | self.full_series.insert(0, patchname) | |
@@ -1357,7 +1361,7 b' class queue:' | |||||
1357 | if filename == '-': |
|
1361 | if filename == '-': | |
1358 | raise util.Abort(_('-e is incompatible with import from -')) |
|
1362 | raise util.Abort(_('-e is incompatible with import from -')) | |
1359 | if not patchname: |
|
1363 | if not patchname: | |
1360 | patchname = filename |
|
1364 | patchname = normname(filename) | |
1361 | if not os.path.isfile(self.join(patchname)): |
|
1365 | if not os.path.isfile(self.join(patchname)): | |
1362 | raise util.Abort(_("patch %s does not exist") % patchname) |
|
1366 | raise util.Abort(_("patch %s does not exist") % patchname) | |
1363 | else: |
|
1367 | else: | |
@@ -1371,7 +1375,7 b' class queue:' | |||||
1371 | except IOError: |
|
1375 | except IOError: | |
1372 | raise util.Abort(_("unable to read %s") % patchname) |
|
1376 | raise util.Abort(_("unable to read %s") % patchname) | |
1373 | if not patchname: |
|
1377 | if not patchname: | |
1374 | patchname = os.path.basename(filename) |
|
1378 | patchname = normname(os.path.basename(filename)) | |
1375 | checkfile(patchname) |
|
1379 | checkfile(patchname) | |
1376 | patchf = self.opener(patchname, "w") |
|
1380 | patchf = self.opener(patchname, "w") | |
1377 | patchf.write(text) |
|
1381 | patchf.write(text) | |
@@ -1804,7 +1808,7 b' def rename(ui, repo, patch, name=None, *' | |||||
1804 | patch = q.lookup('qtip') |
|
1808 | patch = q.lookup('qtip') | |
1805 | absdest = q.join(name) |
|
1809 | absdest = q.join(name) | |
1806 | if os.path.isdir(absdest): |
|
1810 | if os.path.isdir(absdest): | |
1807 | name = os.path.join(name, os.path.basename(patch)) |
|
1811 | name = normname(os.path.join(name, os.path.basename(patch))) | |
1808 | absdest = q.join(name) |
|
1812 | absdest = q.join(name) | |
1809 | if os.path.exists(absdest): |
|
1813 | if os.path.exists(absdest): | |
1810 | raise util.Abort(_('%s already exists') % absdest) |
|
1814 | raise util.Abort(_('%s already exists') % absdest) |
General Comments 0
You need to be logged in to leave comments.
Login now