##// END OF EJS Templates
convert: use return value in parse_view() instead of manipulating state
David Soria Parra -
r30629:e92776c0 default
parent child Browse files
Show More
@@ -95,10 +95,12 b' class p4_source(common.converter_source)'
95 "Read changes affecting the path"
95 "Read changes affecting the path"
96 cmd = 'p4 -G changes -s submitted %s' % util.shellquote(path)
96 cmd = 'p4 -G changes -s submitted %s' % util.shellquote(path)
97 stdout = util.popen(cmd, mode='rb')
97 stdout = util.popen(cmd, mode='rb')
98 p4changes = {}
98 for d in loaditer(stdout):
99 for d in loaditer(stdout):
99 c = d.get("change", None)
100 c = d.get("change", None)
100 if c:
101 if c:
101 self.p4changes[c] = True
102 p4changes[c] = True
103 return p4changes
102
104
103 def _parse(self, ui, path):
105 def _parse(self, ui, path):
104 "Prepare list of P4 filenames and revisions to import"
106 "Prepare list of P4 filenames and revisions to import"
@@ -106,7 +108,7 b' class p4_source(common.converter_source)'
106
108
107 # read client spec or view
109 # read client spec or view
108 if "/" in path:
110 if "/" in path:
109 self._parse_view(path)
111 self.p4changes.update(self._parse_view(path))
110 if path.startswith("//") and path.endswith("/..."):
112 if path.startswith("//") and path.endswith("/..."):
111 views = {path[:-3]:""}
113 views = {path[:-3]:""}
112 else:
114 else:
@@ -119,7 +121,7 b' class p4_source(common.converter_source)'
119 for client in clientspec:
121 for client in clientspec:
120 if client.startswith("View"):
122 if client.startswith("View"):
121 sview, cview = clientspec[client].split()
123 sview, cview = clientspec[client].split()
122 self._parse_view(sview)
124 self.p4changes.update(self._parse_view(sview))
123 if sview.endswith("...") and cview.endswith("..."):
125 if sview.endswith("...") and cview.endswith("..."):
124 sview = sview[:-3]
126 sview = sview[:-3]
125 cview = cview[:-3]
127 cview = cview[:-3]
General Comments 0
You need to be logged in to leave comments. Login now