3036 dia.exec_() |
3036 dia.exec_() |
3037 res = dia.hasAddOrDelete() |
3037 res = dia.hasAddOrDelete() |
3038 self.checkVCSStatus() |
3038 self.checkVCSStatus() |
3039 return res |
3039 return res |
3040 |
3040 |
3041 def hgGraftContinue(self, path): |
3041 def __hgGraftSubCommand(self, path, subcommand, title): |
3042 """ |
3042 """ |
3043 Public method to continue copying changesets from another branch. |
3043 Private method to perform a Mercurial graft subcommand. |
3044 |
3044 |
3045 @param path directory name of the project (string) |
3045 @param path directory name of the project |
3046 @return flag indicating that the project should be reread (boolean) |
3046 @type str |
|
3047 @param subcommand subcommand flag |
|
3048 @type str |
|
3049 @param title tirle of the dialog |
|
3050 @type str |
|
3051 @return flag indicating that the project should be reread |
|
3052 @rtype bool |
3047 """ |
3053 """ |
3048 # find the root of the repo |
3054 # find the root of the repo |
3049 repodir = self.splitPath(path)[0] |
3055 repodir = self.splitPath(path)[0] |
3050 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
3056 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
3051 repodir = os.path.dirname(repodir) |
3057 repodir = os.path.dirname(repodir) |
3052 if os.path.splitdrive(repodir)[1] == os.sep: |
3058 if os.path.splitdrive(repodir)[1] == os.sep: |
3053 return |
3059 return |
3054 |
3060 |
3055 args = self.initCommand("graft") |
3061 args = self.initCommand("graft") |
3056 args.append("--continue") |
3062 args.append(subcommand) |
3057 args.append("--verbose") |
3063 args.append("--verbose") |
3058 |
3064 |
3059 dia = HgDialog(self.tr('Copy Changesets (Continue)'), self) |
3065 dia = HgDialog(title, self) |
3060 res = dia.startProcess(args, repodir) |
3066 res = dia.startProcess(args, repodir) |
3061 if res: |
3067 if res: |
3062 dia.exec_() |
3068 dia.exec_() |
3063 res = dia.hasAddOrDelete() |
3069 res = dia.hasAddOrDelete() |
3064 self.checkVCSStatus() |
3070 self.checkVCSStatus() |
3065 return res |
3071 return res |
3066 # TODO: Mercurial 4.7: add action for graft --stop |
3072 |
3067 # TODO: Mercurial 4.7: add action for graft --abort |
3073 def hgGraftContinue(self, path): |
|
3074 """ |
|
3075 Public method to continue copying changesets from another branch. |
|
3076 |
|
3077 @param path directory name of the project |
|
3078 @type str |
|
3079 @return flag indicating that the project should be reread |
|
3080 @rtype bool |
|
3081 """ |
|
3082 return self.__hgGraftSubCommand( |
|
3083 path, "--continue", self.tr('Copy Changesets (Continue)')) |
|
3084 |
|
3085 def hgGraftStop(self, path): |
|
3086 """ |
|
3087 Public method to stop an interrupted copying session. |
|
3088 |
|
3089 @param path directory name of the project |
|
3090 @type str |
|
3091 @return flag indicating that the project should be reread |
|
3092 @rtype bool |
|
3093 """ |
|
3094 return self.__hgGraftSubCommand( |
|
3095 path, "--stop", self.tr('Copy Changesets (Stop)')) |
|
3096 |
|
3097 def hgGraftAbort(self, path): |
|
3098 """ |
|
3099 Public method to abort an interrupted copying session and perform |
|
3100 a rollback. |
|
3101 |
|
3102 @param path directory name of the project |
|
3103 @type str |
|
3104 @return flag indicating that the project should be reread |
|
3105 @rtype bool |
|
3106 """ |
|
3107 return self.__hgGraftSubCommand( |
|
3108 path, "--abort", self.tr('Copy Changesets (Abort)')) |
3068 |
3109 |
3069 def hgArchive(self): |
3110 def hgArchive(self): |
3070 """ |
3111 """ |
3071 Public method to create an unversioned archive from the repository. |
3112 Public method to create an unversioned archive from the repository. |
3072 """ |
3113 """ |