Plugins/VcsPlugins/vcsMercurial/LargefilesExtension/largefiles.py

changeset 3313
037642483f35
parent 3311
b4775920f5b8
child 3315
bd1a25ead18d
equal deleted inserted replaced
3312:7535e5a5cbce 3313:037642483f35
91 if direction == 'largefiles': 91 if direction == 'largefiles':
92 self.vcs.hgEditConfig(newName, largefilesData={ 92 self.vcs.hgEditConfig(newName, largefilesData={
93 "minsize": minSize, "pattern": patterns}) 93 "minsize": minSize, "pattern": patterns})
94 else: 94 else:
95 self.vcs.hgEditConfig(newName, withLargefiles=False) 95 self.vcs.hgEditConfig(newName, withLargefiles=False)
96
97 def hgAdd(self, names, mode):
98 """
99 Public method used to add a file to the Mercurial repository.
100
101 @param name file name(s) to be added (string or list of string)
102 @param mode add mode (string one of 'normal' or 'large')
103 """
104 args = self.vcs.initCommand("add")
105 args.append("-v")
106 if mode == "large":
107 args.append("--large")
108 else:
109 args.append("--normal")
110
111 if isinstance(names, list):
112 dname = self.vcs.splitPathList(names)[0]
113 else:
114 dname = self.vcs.splitPath(names)[0]
115
116 # find the root of the repo
117 repodir = dname
118 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
119 repodir = os.path.dirname(repodir)
120 if os.path.splitdrive(repodir)[1] == os.sep:
121 return
122
123 if isinstance(names, list):
124 self.vcs.addArguments(args, names)
125 else:
126 args.append(names)
127
128 dia = HgDialog(
129 self.tr('Adding files to the Mercurial repository'),
130 self.vcs)
131 res = dia.startProcess(args, repodir)
132 if res:
133 dia.exec_()

eric ide

mercurial