Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 541
00e1a5d060c5
parent 539
87f9bce38a44
child 546
c3e7bf5648be
equal deleted inserted replaced
540:2631831b4052 541:00e1a5d060c5
1670 "glob:**.bak", 1670 "glob:**.bak",
1671 ] 1671 ]
1672 1672
1673 ignoreName = os.path.join(name, ".hgignore") 1673 ignoreName = os.path.join(name, ".hgignore")
1674 if os.path.exists(ignoreName): 1674 if os.path.exists(ignoreName):
1675 res = E5MessageBox.warning(self.__ui, 1675 res = E5MessageBox.yesNo(self.__ui,
1676 self.trUtf8("Create .hgignore file"), 1676 self.trUtf8("Create .hgignore file"),
1677 self.trUtf8("""<p>The file <b>{0}</b> exists already.""" 1677 self.trUtf8("""<p>The file <b>{0}</b> exists already."""
1678 """ Overwrite it?</p>""").format(ignoreName), 1678 """ Overwrite it?</p>""").format(ignoreName),
1679 QMessageBox.StandardButtons(\ 1679 type_ = E5MessageBox.Warning)
1680 QMessageBox.No | \ 1680 else:
1681 QMessageBox.Yes), 1681 res = True
1682 QMessageBox.No) 1682 if res:
1683 else:
1684 res = QMessageBox.Yes
1685 if res == QMessageBox.Yes:
1686 try: 1683 try:
1687 # create a .hgignore file 1684 # create a .hgignore file
1688 ignore = open(ignoreName, "w") 1685 ignore = open(ignoreName, "w")
1689 ignore.write("\n".join(ignorePatterns)) 1686 ignore.write("\n".join(ignorePatterns))
1690 ignore.write("\n") 1687 ignore.write("\n")
1847 None, 1844 None,
1848 self.trUtf8("Apply changegroups"), 1845 self.trUtf8("Apply changegroups"),
1849 repodir, 1846 repodir,
1850 self.trUtf8("Mercurial Changegroup Files (*.hg);;All Files (*)")) 1847 self.trUtf8("Mercurial Changegroup Files (*.hg);;All Files (*)"))
1851 if files: 1848 if files:
1852 update = E5MessageBox.question(self.__ui, 1849 update = E5MessageBox.yesNo(self.__ui,
1853 self.trUtf8("Apply changegroups"), 1850 self.trUtf8("Apply changegroups"),
1854 self.trUtf8("""Shall the working directory be updated?"""), 1851 self.trUtf8("""Shall the working directory be updated?"""),
1855 QMessageBox.StandardButtons(\ 1852 yesDefault = True)
1856 QMessageBox.No | \
1857 QMessageBox.Yes),
1858 QMessageBox.Yes) == QMessageBox.Yes
1859 1853
1860 args = [] 1854 args = []
1861 args.append('unbundle') 1855 args.append('unbundle')
1862 if update: 1856 if update:
1863 args.append("--update") 1857 args.append("--update")

eric ide

mercurial