Ejemplo n.º 1
0
def add(parent, ui, repo, files):
    haslf = "largefiles" in repo.extensions()
    haskbf = "kbfiles" in repo.extensions()
    if haslf or haskbf:
        result = lfprompt.promptForLfiles(parent, ui, repo, files, haskbf)
        if not result:
            return False
        files, lfiles = result
        for name, module in extensions.extensions():
            if name == "largefiles":
                override_add = module.overrides.override_add
                if files:
                    override_add(commands.add, ui, repo, *files)
                if lfiles:
                    override_add(commands.add, ui, repo, large=True, *lfiles)
                return True
            if name == "kbfiles":
                override_add = module.bfsetup.override_add
                if files:
                    override_add(commands.add, ui, repo, *files)
                if lfiles:
                    override_add(commands.add, ui, repo, bf=True, *lfiles)
                return True
    commands.add(ui, repo, *files)
    return True
Ejemplo n.º 2
0
def add(parent, ui, repo, files):
    if 'largefiles' in repo.extensions():
        result = lfprompt.promptForLfiles(parent, ui, repo, files)
        if not result:
            return False
        files, lfiles = result
        if files:
            commands.add(ui, repo, normal=True, *files)
        if lfiles:
            commands.add(ui, repo, lfsize='', normal=False, large=True, *lfiles)
    else:
        commands.add(ui, repo, *files)
    return True
Ejemplo n.º 3
0
 def _addFileWithPrompt(self, fds):
     repo = self._repoAgentFor(fds[0]).rawRepo()
     result = lfprompt.promptForLfiles(self.parent(), repo.ui, repo,
                                       _lcanonpaths(fds))
     if not result:
         return
     cmdlines = []
     for opt, paths in zip(('normal', 'large'), result):
         if not paths:
             continue
         paths = [hglib.escapepath(hglib.tounicode(e)) for e in paths]
         cmdlines.append(hglib.buildcmdargs('add', *paths, **{opt: True}))
     sess = self._runCommandSequence(cmdlines)
     sess.commandFinished.connect(self._notifyChangesOnCommandFinished)
Ejemplo n.º 4
0
 def addWithPrompt(self, files):
     result = lfprompt.promptForLfiles(self, self.repo.ui, self.repo, files)
     if not result:
         return
     files, lfiles = result
     if files:
         cmdline = ['add']
         cmdline.extend(files)
         self.files = files
         self.cmd.run(cmdline)
     if lfiles:
         if 'largefiles' in self.repo.extensions():
             cmdline = ['add', '--large']
         cmdline.extend(lfiles)
         self.files = lfiles
         self.cmd.run(cmdline)
Ejemplo n.º 5
0
 def addWithPrompt(self, files):
     result = lfprompt.promptForLfiles(self, self.repo.ui, self.repo, files)
     if not result:
         return
     files, lfiles = result
     self._runCommand(files, lfiles, {})