Plugins/VcsPlugins/vcsMercurial/hg.py

branch
5_4_x
changeset 3672
01e4aee3c3ee
parent 3437
478c6fa42557
equal deleted inserted replaced
3661:9f5d0a07e69b 3672:01e4aee3c3ee
1113 else: 1113 else:
1114 output, error = self.__client.runcommand(args) 1114 output, error = self.__client.runcommand(args)
1115 1115
1116 if output: 1116 if output:
1117 for line in output.splitlines(): 1117 for line in output.splitlines():
1118 flag, path = line.split(" ", 1) 1118 if line and line[0] in "MARC!?I":
1119 absname = os.path.join(repodir, os.path.normcase(path)) 1119 flag, path = line.split(" ", 1)
1120 if flag not in "?I": 1120 absname = os.path.join(repodir, os.path.normcase(path))
1121 if fname == '.': 1121 if flag not in "?I":
1122 if absname.startswith(dname + os.path.sep): 1122 if fname == '.':
1123 return self.canBeCommitted 1123 if absname.startswith(dname + os.path.sep):
1124 if absname == dname: 1124 return self.canBeCommitted
1125 return self.canBeCommitted 1125 if absname == dname:
1126 else: 1126 return self.canBeCommitted
1127 if absname == name: 1127 else:
1128 return self.canBeCommitted 1128 if absname == name:
1129 return self.canBeCommitted
1129 1130
1130 return self.canBeAdded 1131 return self.canBeAdded
1131 1132
1132 def vcsAllRegisteredStates(self, names, dname, shortcut=True): 1133 def vcsAllRegisteredStates(self, names, dname, shortcut=True):
1133 """ 1134 """
1184 output, error = self.__client.runcommand(args) 1185 output, error = self.__client.runcommand(args)
1185 1186
1186 if output: 1187 if output:
1187 dirs = [x for x in names.keys() if os.path.isdir(x)] 1188 dirs = [x for x in names.keys() if os.path.isdir(x)]
1188 for line in output.splitlines(): 1189 for line in output.splitlines():
1189 flag, path = line.split(" ", 1) 1190 if line and line[0] in "MARC!?I":
1190 name = os.path.normcase(os.path.join(repodir, path)) 1191 flag, path = line.split(" ", 1)
1191 dirName = os.path.dirname(name) 1192 name = os.path.normcase(os.path.join(repodir, path))
1192 if name.startswith(dname): 1193 dirName = os.path.dirname(name)
1194 if name.startswith(dname):
1195 if flag not in "?I":
1196 if name in names:
1197 names[name] = self.canBeCommitted
1198 if dirName in names:
1199 names[dirName] = self.canBeCommitted
1200 if dirs:
1201 for d in dirs:
1202 if name.startswith(d):
1203 names[d] = self.canBeCommitted
1204 dirs.remove(d)
1205 break
1193 if flag not in "?I": 1206 if flag not in "?I":
1194 if name in names: 1207 self.statusCache[name] = self.canBeCommitted
1195 names[name] = self.canBeCommitted 1208 self.statusCache[dirName] = self.canBeCommitted
1196 if dirName in names: 1209 else:
1197 names[dirName] = self.canBeCommitted 1210 self.statusCache[name] = self.canBeAdded
1198 if dirs: 1211 if dirName not in self.statusCache:
1199 for d in dirs: 1212 self.statusCache[dirName] = self.canBeAdded
1200 if name.startswith(d):
1201 names[d] = self.canBeCommitted
1202 dirs.remove(d)
1203 break
1204 if flag not in "?I":
1205 self.statusCache[name] = self.canBeCommitted
1206 self.statusCache[dirName] = self.canBeCommitted
1207 else:
1208 self.statusCache[name] = self.canBeAdded
1209 if dirName not in self.statusCache:
1210 self.statusCache[dirName] = self.canBeAdded
1211 1213
1212 return names 1214 return names
1213 1215
1214 def clearStatusCache(self): 1216 def clearStatusCache(self):
1215 """ 1217 """

eric ide

mercurial