eric6/Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 8259
2bbec88047dd
parent 8243
cc717c2ae956
child 8273
698ae46f40a4
child 8381
600bf716cb9d
equal deleted inserted replaced
8258:82b608e352ec 8259:2bbec88047dd
1242 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" 1242 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n"""
1243 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" 1243 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n"""
1244 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>""") 1244 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>""")
1245 .format(author, cdate, ctime)) 1245 .format(author, cdate, ctime))
1246 infoBlock.append("\n".join(info)) 1246 infoBlock.append("\n".join(info))
1247 if infoBlock: 1247 infoStr = (
1248 infoStr = """<tr></tr>{0}""".format("<tr></tr>".join(infoBlock)) 1248 """<tr></tr>{0}""".format("<tr></tr>".join(infoBlock))
1249 else: 1249 if infoBlock else
1250 infoStr = "" 1250 ""
1251 )
1251 1252
1252 url = "" 1253 url = ""
1253 args = self.initCommand("showconfig") 1254 args = self.initCommand("showconfig")
1254 args.append('paths.default') 1255 args.append('paths.default')
1255 1256
1778 if isinstance(name, list): 1779 if isinstance(name, list):
1779 self.addArguments(args, name) 1780 self.addArguments(args, name)
1780 else: 1781 else:
1781 args.append(name) 1782 args.append(name)
1782 1783
1783 if unresolve: 1784 title = (
1784 title = self.tr("Marking as 'unresolved'") 1785 self.tr("Marking as 'unresolved'")
1785 else: 1786 if unresolve else
1786 title = self.tr("Marking as 'resolved'") 1787 self.tr("Marking as 'resolved'")
1788 )
1787 dia = HgDialog(title, self) 1789 dia = HgDialog(title, self)
1788 res = dia.startProcess(args) 1790 res = dia.startProcess(args)
1789 if res: 1791 if res:
1790 dia.exec() 1792 dia.exec()
1791 self.checkVCSStatus() 1793 self.checkVCSStatus()
2016 "glob:__pycache__", 2018 "glob:__pycache__",
2017 "glob:**.DS_Store", 2019 "glob:**.DS_Store",
2018 ] 2020 ]
2019 2021
2020 ignoreName = os.path.join(name, Hg.IgnoreFileName) 2022 ignoreName = os.path.join(name, Hg.IgnoreFileName)
2021 if os.path.exists(ignoreName): 2023 res = (
2022 res = E5MessageBox.yesNo( 2024 E5MessageBox.yesNo(
2023 self.__ui, 2025 self.__ui,
2024 self.tr("Create .hgignore file"), 2026 self.tr("Create .hgignore file"),
2025 self.tr("""<p>The file <b>{0}</b> exists already.""" 2027 self.tr("""<p>The file <b>{0}</b> exists already."""
2026 """ Overwrite it?</p>""").format(ignoreName), 2028 """ Overwrite it?</p>""").format(ignoreName),
2027 icon=E5MessageBox.Warning) 2029 icon=E5MessageBox.Warning)
2028 else: 2030 if os.path.exists(ignoreName) else
2029 res = True 2031 True
2032 )
2030 if res: 2033 if res:
2031 try: 2034 try:
2032 # create a .hgignore file 2035 # create a .hgignore file
2033 with open(ignoreName, "w") as ignore: 2036 with open(ignoreName, "w") as ignore:
2034 ignore.write("\n".join(ignorePatterns)) 2037 ignore.write("\n".join(ignorePatterns))
3158 @param incoming flag indicating to get incoming bookmarks (boolean) 3161 @param incoming flag indicating to get incoming bookmarks (boolean)
3159 @return list of bookmarks (list of string) 3162 @return list of bookmarks (list of string)
3160 """ 3163 """
3161 bookmarksList = [] 3164 bookmarksList = []
3162 3165
3163 if incoming: 3166 args = (
3164 args = self.initCommand("incoming") 3167 self.initCommand("incoming")
3165 else: 3168 if incoming else
3166 args = self.initCommand("outgoing") 3169 self.initCommand("outgoing")
3170 )
3167 args.append('--bookmarks') 3171 args.append('--bookmarks')
3168 3172
3169 client = self.getClient() 3173 client = self.getClient()
3170 output = client.runcommand(args)[0] 3174 output = client.runcommand(args)[0]
3171 3175

eric ide

mercurial