3802 name = " ".join(li) |
3802 name = " ".join(li) |
3803 bookmarksList.append(name) |
3803 bookmarksList.append(name) |
3804 |
3804 |
3805 return bookmarksList |
3805 return bookmarksList |
3806 |
3806 |
3807 def hgBookmarkPull(self, name): |
3807 def hgBookmarkPull(self, name, current=False): |
3808 """ |
3808 """ |
3809 Public method to pull a bookmark from a remote repository. |
3809 Public method to pull a bookmark from a remote repository. |
3810 |
3810 |
3811 @param name file/directory name (string) |
3811 @param name file/directory name |
|
3812 @type str |
|
3813 @param current flag indicating to pull the current bookmark |
|
3814 @type bool |
3812 """ |
3815 """ |
3813 # find the root of the repo |
3816 # find the root of the repo |
3814 repodir = self.splitPath(name)[0] |
3817 repodir = self.splitPath(name)[0] |
3815 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
3818 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
3816 repodir = os.path.dirname(repodir) |
3819 repodir = os.path.dirname(repodir) |
3817 if os.path.splitdrive(repodir)[1] == os.sep: |
3820 if os.path.splitdrive(repodir)[1] == os.sep: |
3818 return |
3821 return |
3819 |
3822 |
3820 bookmarks = self.__getInOutBookmarks(repodir, True) |
3823 if current: |
3821 |
3824 bookmark = "." |
3822 bookmark, ok = QInputDialog.getItem( |
3825 ok = True |
3823 None, |
3826 else: |
3824 self.tr("Pull Bookmark"), |
3827 bookmarks = self.__getInOutBookmarks(repodir, True) |
3825 self.tr("Select the bookmark to be pulled:"), |
3828 |
3826 [""] + sorted(bookmarks), |
3829 bookmark, ok = QInputDialog.getItem( |
3827 0, True) |
3830 None, |
|
3831 self.tr("Pull Bookmark"), |
|
3832 self.tr("Select the bookmark to be pulled:"), |
|
3833 [""] + sorted(bookmarks), |
|
3834 0, True) |
3828 if ok and bookmark: |
3835 if ok and bookmark: |
3829 args = self.initCommand("pull") |
3836 args = self.initCommand("pull") |
3830 args.append('--bookmark') |
3837 args.append('--bookmark') |
3831 args.append(bookmark) |
3838 args.append(bookmark) |
3832 |
3839 |
3835 self) |
3842 self) |
3836 res = dia.startProcess(args, repodir) |
3843 res = dia.startProcess(args, repodir) |
3837 if res: |
3844 if res: |
3838 dia.exec_() |
3845 dia.exec_() |
3839 |
3846 |
3840 def hgBookmarkPush(self, name): |
3847 def hgBookmarkPush(self, name, current=False): |
3841 """ |
3848 """ |
3842 Public method to push a bookmark to a remote repository. |
3849 Public method to push a bookmark to a remote repository. |
3843 |
3850 |
3844 @param name file/directory name (string) |
3851 @param name file/directory name |
|
3852 @type str |
|
3853 @param current flag indicating to push the current bookmark |
|
3854 @type bool |
3845 """ |
3855 """ |
3846 # find the root of the repo |
3856 # find the root of the repo |
3847 repodir = self.splitPath(name)[0] |
3857 repodir = self.splitPath(name)[0] |
3848 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
3858 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
3849 repodir = os.path.dirname(repodir) |
3859 repodir = os.path.dirname(repodir) |
3850 if os.path.splitdrive(repodir)[1] == os.sep: |
3860 if os.path.splitdrive(repodir)[1] == os.sep: |
3851 return |
3861 return |
3852 |
3862 |
3853 bookmarks = self.__getInOutBookmarks(repodir, False) |
3863 if current: |
3854 |
3864 bookmark = "." |
3855 bookmark, ok = QInputDialog.getItem( |
3865 ok = True |
3856 None, |
3866 else: |
3857 self.tr("Push Bookmark"), |
3867 bookmarks = self.__getInOutBookmarks(repodir, False) |
3858 self.tr("Select the bookmark to be push:"), |
3868 |
3859 [""] + sorted(bookmarks), |
3869 bookmark, ok = QInputDialog.getItem( |
3860 0, True) |
3870 None, |
|
3871 self.tr("Push Bookmark"), |
|
3872 self.tr("Select the bookmark to be push:"), |
|
3873 [""] + sorted(bookmarks), |
|
3874 0, True) |
3861 if ok and bookmark: |
3875 if ok and bookmark: |
3862 args = self.initCommand("push") |
3876 args = self.initCommand("push") |
3863 args.append('--bookmark') |
3877 args.append('--bookmark') |
3864 args.append(bookmark) |
3878 args.append(bookmark) |
3865 |
3879 |