Show More
@@ -17,28 +17,26 b' repomap = {}' | |||
|
17 | 17 | |
|
18 | 18 | class queue: |
|
19 | 19 | def __init__(self, ui, path, patchdir=None): |
|
20 | self.opener = util.opener(path) | |
|
21 | 20 | self.basepath = path |
|
22 | 21 | if patchdir: |
|
23 | 22 | self.path = patchdir |
|
24 | 23 | else: |
|
25 | 24 | self.path = os.path.join(path, "patches") |
|
25 | self.opener = util.opener(self.path) | |
|
26 | 26 | self.ui = ui |
|
27 | 27 | self.applied = [] |
|
28 | 28 | self.full_series = [] |
|
29 | 29 | self.applied_dirty = 0 |
|
30 | 30 | self.series_dirty = 0 |
|
31 |
self.series_path = |
|
|
32 |
self.status_path = |
|
|
31 | self.series_path = "series" | |
|
32 | self.status_path = "status" | |
|
33 | 33 | |
|
34 | s = self.series_path | |
|
35 | if os.path.exists(s): | |
|
36 | self.full_series = self.opener(s).read().splitlines() | |
|
34 | if os.path.exists(os.path.join(self.path, self.series_path)): | |
|
35 | self.full_series = self.opener(self.series_path).read().splitlines() | |
|
37 | 36 | self.read_series(self.full_series) |
|
38 | 37 | |
|
39 | s = self.status_path | |
|
40 | if os.path.exists(s): | |
|
41 | self.applied = self.opener(s).read().splitlines() | |
|
38 | if os.path.exists(os.path.join(self.path, self.status_path)): | |
|
39 | self.applied = self.opener(self.status_path).read().splitlines() | |
|
42 | 40 | |
|
43 | 41 | def find_series(self, patch): |
|
44 | 42 | pre = re.compile("(\s*)([^#]+)") |
@@ -186,7 +184,7 b' class queue:' | |||
|
186 | 184 | self.ui.warn("Unable to read %s\n" % patch) |
|
187 | 185 | sys.exit(1) |
|
188 | 186 | |
|
189 |
patchf = self.opener( |
|
|
187 | patchf = self.opener(patch, "w") | |
|
190 | 188 | if comments: |
|
191 | 189 | comments = "\n".join(comments) + '\n\n' |
|
192 | 190 | patchf.write(comments) |
@@ -402,7 +400,7 b' class queue:' | |||
|
402 | 400 | self.read_series(self.full_series) |
|
403 | 401 | self.series_dirty = 1 |
|
404 | 402 | self.applied_dirty = 1 |
|
405 |
p = self.opener( |
|
|
403 | p = self.opener(patch, "w") | |
|
406 | 404 | if msg: |
|
407 | 405 | msg = msg + "\n" |
|
408 | 406 | p.write(msg) |
@@ -716,7 +714,7 b' class queue:' | |||
|
716 | 714 | patchparent = self.qparents(repo, top) |
|
717 | 715 | message, comments, user, patchfound = self.readheaders(patch) |
|
718 | 716 | |
|
719 |
patchf = self.opener( |
|
|
717 | patchf = self.opener(patch, "w") | |
|
720 | 718 | if comments: |
|
721 | 719 | comments = "\n".join(comments) + '\n\n' |
|
722 | 720 | patchf.write(comments) |
@@ -835,8 +833,9 b' class queue:' | |||
|
835 | 833 | d = root[len(self.path) + 1:] |
|
836 | 834 | for f in files: |
|
837 | 835 | fl = os.path.join(d, f) |
|
838 |
if (fl not in self.series and |
|
|
839 | fl != "series" and not fl.startswith('.')): | |
|
836 | if (fl not in self.series and | |
|
837 | fl not in (self.status_path, self.series_path) | |
|
838 | and not fl.startswith('.')): | |
|
840 | 839 | list.append(fl) |
|
841 | 840 | list.sort() |
|
842 | 841 | if list: |
@@ -1012,7 +1011,7 b' class queue:' | |||
|
1012 | 1011 | if not force and os.path.isfile(os.path.join(self.path, patch)): |
|
1013 | 1012 | self.ui.warn("patch %s already exists\n" % patch) |
|
1014 | 1013 | sys.exit(1) |
|
1015 |
patchf = self.opener( |
|
|
1014 | patchf = self.opener(patch, "w") | |
|
1016 | 1015 | patchf.write(text) |
|
1017 | 1016 | if patch in self.series: |
|
1018 | 1017 | self.ui.warn("patch %s is already in the series file\n" % patch) |
@@ -1205,7 +1204,7 b' def save(ui, repo, **opts):' | |||
|
1205 | 1204 | util.copyfiles(path, newpath) |
|
1206 | 1205 | if opts['empty']: |
|
1207 | 1206 | try: |
|
1208 | os.unlink(q.status_path) | |
|
1207 | os.unlink(os.path.join(q.path, q.status_path)) | |
|
1209 | 1208 | except: |
|
1210 | 1209 | pass |
|
1211 | 1210 | return 0 |
General Comments 0
You need to be logged in to leave comments.
Login now