Ejemplo n.º 1
0
                           _("Running Clean Command..."))
        self.action.append(self.git.clean, self.path, remove_dir,
                           remove_ignored_too, remove_only_ignored, dry_run,
                           force)
        self.action.append(self.action.set_status, _("Completed Clean"))
        self.action.append(self.action.finish)
        self.action.schedule()

    def on_remove_ignored_too_toggled(self, widget):
        remove_ignored_too = self.get_widget("remove_ignored_too")
        remove_only_ignored = self.get_widget("remove_only_ignored")

        if remove_ignored_too.get_active():
            remove_only_ignored.set_active(False)

    def on_remove_only_ignored_toggled(self, widget):
        remove_ignored_too = self.get_widget("remove_ignored_too")
        remove_only_ignored = self.get_widget("remove_only_ignored")

        if remove_only_ignored.get_active():
            remove_ignored_too.set_active(False)


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs clean path")

    window = GitClean(paths[0])
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 2
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        rabbitvcs.util.helper.launch_merge_tool(self.path)
        
        self.close()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNEditConflicts,
    rabbitvcs.vcs.VCS_GIT: GitEditConflicts
}

def editconflicts_factory(path):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path)
        
if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main(
        [BASEDIR_OPT],
        usage="Usage: rabbitvcs edit-conflicts [path1] [path2] ..."
    )

    window = editconflicts_factory(paths[0])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 3
0
        self.action.append(self.action.set_status,
                           _("Running Merge Command..."))
        self.action.append(self.git.merge, from_branch)

        self.action.append(self.action.set_status, _("Completed Merge"))
        self.action.append(self.action.finish)
        self.action.start()

    def __revision_changed(self, widget):
        self.update_branch_info()


if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main(
        [VCS_OPT],
        usage="Usage: rabbitvcs merge path [revision/revision_range]")

    path = args[0]

    vcs_name = options.vcs
    if not vcs_name:
        vcs_name = rabbitvcs.vcs.guess(path)["vcs"]

    window = None
    revision_text = None
    if len(args) >= 2:
        revision_text = args[1]

    if vcs_name == rabbitvcs.vcs.VCS_SVN:
        window = SVNMerge(path, revision_text)
Ejemplo n.º 4
0
            self.path,
            url,
            self.message.get_text(),
            ignore=ignore
        )
        self.action.append(self.action.set_status, _("Completed Import"))
        self.action.append(self.action.finish)
        self.action.start()

    def on_previous_messages_clicked(self, widget, data=None):
        dialog = rabbitvcs.ui.dialog.PreviousMessages()
        message = dialog.run()
        if message is not None:
            self.message.set_text(message)

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNImport
}

def import_factory(path):
    vcs = rabbitvcs.vcs.VCS_SVN    
    return classes_map[vcs](path)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs import [path]")
            
    window = import_factory(paths[0])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 5
0
                        rabbitvcs.util.helper.format_long_text(item.message.rstrip("\n"))
                    ])
                    has_commits = True
                else:
                    break

            except IndexError:
                break

        if not has_commits:
            self.get_widget("ok").set_sensitive(False)
            self.get_widget("status").set_text(_("No commits found"))

classes_map = {
    rabbitvcs.vcs.VCS_GIT: GitPush
}

def push_factory(path):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path)
    
if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(
        usage="Usage: rabbitvcs push [path]"
    )

    window = push_factory(paths[0])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 6
0
    if vcs == rabbitvcs.vcs.VCS_DUMMY:
        return SVNCheckout(path, url, revision)
    elif vcs == rabbitvcs.vcs.VCS_GIT:
        if quiet:
            return GitCheckoutQuiet(path)
        else:
            return GitCheckout(path, url, revision)

    return classes_map[vcs](path, url, revision)


if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT, QUIET_OPT
    (options, args) = main(
        [REVISION_OPT, VCS_OPT, QUIET_OPT],
        usage="Usage: rabbitvcs checkout --vcs=[git|svn] [url] [path]")

    # If two arguments are passed:
    #   The first argument is expected to be a url
    #   The second argument is expected to be a path
    # If one argument is passed:
    #   If the argument exists, it is a path
    #   Otherwise, it is a url
    path = url = None
    if len(args) == 2:
        path = args[0]
        url = args[1]
    elif len(args) == 1:
        if os.path.exists(args[0]):
            path = args[0]
Ejemplo n.º 7
0
        )
        self.action.append(self.action.set_status, _("Completed Reset"))
        self.action.append(self.action.finish)
        self.action.schedule()

    def on_browse_clicked(self, widget, data=None):
        chooser = rabbitvcs.ui.dialog.FolderChooser()
        path = chooser.run()
        if path is not None:
            self.get_widget("path").set_text(path)

    def on_path_changed(self, widget, data=None):
        self.check_path()

    def check_path(self):
        path = self.get_widget("path").get_text()
        root = self.git.find_repository_path(path)
        if root != path:
            self.get_widget("none_opt").set_active(True)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs reset [-r REVISION] path"
    )

    window = GitReset(paths[0], options.revision)
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 8
0
    def on_cache_clear_authentication_clicked(self, widget):
        confirmation = rabbitvcs.ui.dialog.Confirmation(
            _("Are you sure you want to clear your authentication information?"
              ))
        if confirmation.run() == Gtk.ResponseType.OK:
            home_dir = helper.get_user_path()
            subpaths = [
                '/.subversion/auth/svn.simple',
                '/.subversion/auth/svn.ssl.server',
                '/.subversion/auth/svn.username'
            ]
            for subpath in subpaths:
                path = "%s%s" % (home_dir, subpath)
                if os.path.exists(path):
                    files = os.listdir(path)
                    for filename in files:
                        filepath = "%s/%s" % (path, filename)
                        os.remove(filepath)

            rabbitvcs.ui.dialog.MessageBox(
                _("Authentication information cleared"))


if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main([BASEDIR_OPT], usage="Usage: rabbitvcs settings")

    window = Settings(options.base_dir)
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 9
0
        
            # Note: if we don't want to ignore errors here, we could define a
            # function that logs failures.
            shutil.rmtree(temp_dir, ignore_errors = True)
        
        self.action.append(create_patch_action, path, items, self.common)
        
        self.action.append(self.action.set_status, _("Patch File Created"))
        self.action.append(self.action.finish)
        self.action.start()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNCreatePatch,
    rabbitvcs.vcs.VCS_GIT: GitCreatePatch
}

def createpatch_factory(paths, base_dir):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir)

if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main(
        [BASEDIR_OPT],
        usage="Usage: rabbitvcs createpatch [path1] [path2] ..."
    )
        
    window = createpatch_factory(paths, options.base_dir)
    window.register_gtk_quit()
    gtk.main()
    def __init__(self, path, propdetails):
        self.path = path
        self.propdetails = propdetails
    
    def all_modified(self):
        return all([detail["status"] != "unchanged"
                       for (propname, detail) in self.propdetails.items()])
    
    def all_not_deleted(self):
        return all([detail["status"] != "deleted"
                       for (propname, detail) in self.propdetails.items()])
    
    def property_revert(self):
        return False
        # return self.all_modified()
    
    def property_delete(self):
        return self.all_not_deleted()
    
    def property_edit(self):
        return len(self.propdetails.keys()) == 1

if __name__ == "__main__":
    # These are some dumb tests before I add any functionality.
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs propedit [url_or_path]")
    
    window = PropEditor(paths[0])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 11
0
        self.action = rabbitvcs.ui.action.GitAction(
            self.git,
            register_gtk_quit=self.gtk_quit_is_set()
        )
        self.action.set_pbar_ticks(ticks)
        self.action.append(self.action.set_header, _("Apply Patch"))
        self.action.append(self.action.set_status, _("Applying Patch File..."))
        self.action.append(self.git.apply_patch, path, base_dir)
        self.action.append(self.action.set_status, _("Patch File Applied"))
        self.action.append(self.action.finish)
        self.action.start()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNApplyPatch,
    rabbitvcs.vcs.VCS_GIT: GitApplyPatch
}

def applypatch_factory(paths):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs applypatch [path1] [path2] ...")

    window = applypatch_factory(paths)
    window.register_gtk_quit()
    window.start()
    gtk.main()
    
Ejemplo n.º 12
0
    def on_repo_browser_clicked(self, widget, data=None):
        from rabbitvcs.ui.browser import BrowserDialog
        BrowserDialog(self.from_urls.get_active_text(), 
            callback=self.on_repo_browser_closed)

    def on_repo_browser_closed(self, new_url):
        self.from_urls.set_child_text(new_url)

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNBranch
}

def branch_factory(vcs, path, revision=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]
        
    return classes_map[vcs](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, args) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs branch [url_or_path]"
    )

    window = branch_factory(options.vcs, args[0], options.revision)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 13
0
            (MenuCompare, None),
            (MenuSeparator, None),
            (MenuUpdate, None)
        ]

    def show(self):
        if len(self.paths) == 0:
            return

        context_menu = GtkContextMenu(self.structure, self.conditions, self.callbacks)
        context_menu.show(self.event)

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNCheckForModifications
}

def checkmods_factory(paths, base_dir):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir)

if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main(
        [BASEDIR_OPT],
        usage="Usage: rabbitvcs checkmods [url_or_path]"
    )

    window = checkmods_factory(paths, options.base_dir)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 14
0
        self.on_treeview_event(treeview, data)

    def on_treeview_cell_edited_event(self, cell, row, data, column):
        self.items_treeview.set_row_item(row, column, data)
        self.save(row, column, data)

    def on_treeview_event(self, treeview, data):
        selected = self.items_treeview.get_selected_row_items(0)
        if len(selected) > 0:
            if len(selected) == 1:
                self.show_edit(selected[0])
            self.get_widget("delete").set_sensitive(True)

    def show_add(self):
        self.state = STATE_ADD
        self.items_treeview.unselect_all()
        
        self.items_treeview.append(["", ""])
        self.items_treeview.focus(1, 0)
    
    def show_edit(self, remote_name):
        self.state = STATE_EDIT

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs branch-manager path")
    
    window = GitRemotes(paths[0])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 15
0
        self.action.append(self.action.set_status, _("Completed Checkout"))
        self.action.append(self.action.finish)
        self.action.schedule()

    def on_revision_changed(self, revision_selector):
        pass


classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNUpdateToRevision,
    rabbitvcs.vcs.VCS_GIT: GitUpdateToRevision,
}


def updateto_factory(vcs, path, revision=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]

    return classes_map[vcs](path, revision)


if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, args) = main([REVISION_OPT, VCS_OPT],
                           usage="Usage: rabbitvcs updateto [path]")

    window = updateto_factory(options.vcs, args[0], revision=options.revision)
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 16
0
            run_in_thread=False
        )
        self.action.append(self.git.blame, [path], line)
        self.action.schedule()

def blame_factory(vcs, path=None, line=0):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]

    return GitBlame(path, line)

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main(
        [VCS_OPT],
        usage="Usage: rabbitvcs blame [path] [line]"
    )

    # If two arguments are passed:
    #   The first argument is expected to be a path
    #   The second argument is expected to be a line number
    # If one argument is passed:
    #   If it is a path
    path = None
    line = 0
    if len(args) == 2:
        path = args[0]
        line = args[1]
    elif len(args) == 1:
        path = args[0]
Ejemplo n.º 17
0
        self.action.append(self.action.set_header, _("Switch"))
        self.action.append(self.action.set_status,
                           _("Running Switch Command..."))
        self.action.append(helper.save_repository_path, url)
        self.action.append(self.svn.switch,
                           self.path,
                           helper.quote_url(url),
                           revision=revision)
        self.action.append(self.action.set_status, _("Completed Switch"))
        self.action.append(self.action.finish)
        self.action.schedule()


classes_map = {rabbitvcs.vcs.VCS_SVN: SVNSwitch}


def switch_factory(path, revision=None):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path, revision)


if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT
    (options, args) = main([REVISION_OPT],
                           usage="Usage: rabbitvcs switch [url]")

    window = switch_factory(args[0], revision=options.revision)
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 18
0
        relative_path = path
        if path.startswith(repo_path):
            relative_path = path[len(repo_path) + 1:]

        dest_path = "%s/%s" % (dest_dir, relative_path)

        helper.open_item(dest_path)

        raise SystemExit()


classes_map = {rabbitvcs.vcs.VCS_SVN: SVNOpen, rabbitvcs.vcs.VCS_GIT: GitOpen}


def open_factory(vcs, path, revision):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]

    return classes_map[vcs](path, revision)


if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main([REVISION_OPT, VCS_OPT],
                            usage="Usage: rabbitvcs open path [-r REVISION]")

    window = open_factory(options.vcs, paths[0], options.revision)
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 19
0
                          (MenuBrowserCopyUrlToClipboard, None),
                          (MenuBrowserMoveTo, None)]

    def show(self):
        if len(self.paths) == 0:
            return

        context_menu = GtkContextMenu(self.structure, self.conditions,
                                      self.callbacks)
        context_menu.show(self.event)


classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNBrowser,
    rabbitvcs.vcs.VCS_DUMMY: SVNBrowser
}


def browser_factory(path):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path)


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, url) = main(usage="Usage: rabbitvcs browser [url]")

    window = browser_factory(url[0])
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 20
0
            self.svn, register_gtk_quit=self.gtk_quit_is_set())

        self.action.append(self.action.set_header, _("Mark as Resolved"))
        self.action.append(self.action.set_status,
                           _("Running Resolved Command..."))
        for item in items:
            self.action.append(self.svn.resolve, item, recurse=True)
        self.action.append(self.action.set_status,
                           _("Completed Mark as Resolved"))
        self.action.append(self.action.finish)
        self.action.schedule()


classes_map = {rabbitvcs.vcs.VCS_SVN: SVNMarkResolved}


def markresolved_factory(paths, base_dir=None):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir)


if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options,
     paths) = main([BASEDIR_OPT],
                   usage="Usage: rabbitvcs markresolved [path1] [path2] ...")

    window = markresolved_factory(paths, options.base_dir)
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 21
0
            if fetch_all:
                git_function_params.append ("all")
                repository = ""
                branch = ""

            self.action.append(self.git.pull, repository, branch, git_function_params)

        self.action.append(self.action.set_status, _("Completed Update"))
        self.action.append(self.action.finish)
        self.action.start()


classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNUpdate, 
    rabbitvcs.vcs.VCS_GIT: GitUpdate
}

def update_factory(paths):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs update [path1] [path2] ...")

    window = update_factory(paths)
    window.register_gtk_quit()
    if isinstance(window, SVNUpdate):
        window.start()
    gtk.main()
Ejemplo n.º 22
0
classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNDiff,
    rabbitvcs.vcs.VCS_GIT: GitDiff
}

def diff_factory(vcs, path1, revision_obj1, path2=None, revision_obj2=None, sidebyside=False):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path1)
        vcs = guess["vcs"]

    return classes_map[vcs](path1, revision_obj1, path2, revision_obj2, sidebyside)

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main([
        (["-s", "--sidebyside"], {
            "help":     _("View diff as side-by-side comparison"), 
            "action":   "store_true", 
            "default":  False
        }), VCS_OPT],
        usage="Usage: rabbitvcs diff [url1@rev1] [url2@rev2]"
    )
    
    pathrev1 = rabbitvcs.util.helper.parse_path_revision_string(args.pop(0))
    pathrev2 = (None, None)
    if len(args) > 0:
        pathrev2 = rabbitvcs.util.helper.parse_path_revision_string(args.pop(0))

    diff_factory(options.vcs, pathrev1[0], pathrev1[1], pathrev2[0], pathrev2[1], sidebyside=options.sidebyside)
Ejemplo n.º 23
0
        self.close()



classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNIgnore,
    rabbitvcs.vcs.VCS_GIT: GitIgnore
}

def ignore_factory(path, pattern):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path, pattern)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, args) = main(usage="Usage: rabbitvcs ignore <folder> <pattern>")

    path = getcwd()
    pattern = ""
    if args:
        if len(args) == 1:
            pattern = args[0]
        else:
            if args[0] != ".":
                path = args[0]
            pattern = args[1]

    window = ignore_factory(path, pattern)
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 24
0
        if not from_url or not to_url:
            MessageBox(_("The from and to url fields are both required."))
            return
    
        self.hide()

        self.action = SVNAction(
            self.svn,
            register_gtk_quit=self.gtk_quit_is_set()
        )
        
        self.action.append(self.action.set_header, _("Relocate"))
        self.action.append(self.action.set_status, _("Running Relocate Command..."))
        self.action.append(
            self.svn.relocate, 
            from_url,
            to_url,
            self.path
        )
        self.action.append(self.action.set_status, _("Completed Relocate"))
        self.action.append(self.action.finish)
        self.action.start()

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs relocate [path]")
            
    window = Relocate(paths[0])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 25
0
            from_branch
        )

        self.action.append(self.action.set_status, _("Completed Merge"))
        self.action.append(self.action.finish)
        self.action.start()

    def __revision_changed(self, widget):
        self.update_branch_info()

           

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main(
        [VCS_OPT],
        usage="Usage: rabbitvcs merge path [revision/revision_range]"
    )

    path = args[0]

    vcs_name = options.vcs
    if not vcs_name:
        vcs_name = rabbitvcs.vcs.guess(path)["vcs"]    
    
    window = None
    revision_text = None
    if len(args) >= 2:
        revision_text = args[1]

    if vcs_name == rabbitvcs.vcs.VCS_SVN:
        window = SVNMerge(path, revision_text)
Ejemplo n.º 26
0
            self.caller, self.base_dir, self.vcs, paths)

        self.structure = [(MenuViewDiff, None), (MenuCompare, None),
                          (MenuSeparator, None), (MenuUpdate, None)]

    def show(self):
        if len(self.paths) == 0:
            return

        context_menu = GtkContextMenu(self.structure, self.conditions,
                                      self.callbacks)
        context_menu.show(self.event)


classes_map = {rabbitvcs.vcs.VCS_SVN: SVNCheckForModifications}


def checkmods_factory(paths, base_dir):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir)


if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main([BASEDIR_OPT],
                            usage="Usage: rabbitvcs checkmods [url_or_path]")

    window = checkmods_factory(paths, options.base_dir)
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 27
0
        if self.get_widget("destination").get_text() == "":
            self.complete = False
        
        self.get_widget("ok").set_sensitive(self.complete)

classes_map = {
    rabbitvcs.vcs.VCS_GIT: GitClone
}

def clone_factory(classes_map, vcs, path=None, url=None):
    return classes_map[vcs](path, url)

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main(
        [VCS_OPT],
        usage="Usage: rabbitvcs clone --vcs=git [url] [path]"
    )
    
    # Default to using git
    vcs = rabbitvcs.vcs.VCS_GIT
    if options.vcs:
        vcs = options.vcs
    
    # If two arguments are passed:
    #   The first argument is expected to be a url
    #   The second argument is expected to be a path
    # If one argument is passed:
    #   If the argument exists, it is a path
    #   Otherwise, it is a url
    path = url = None
    if len(args) == 2:
Ejemplo n.º 28
0
        self.action.append(self.action.set_status, _("Running Switch Command..."))
        self.action.append(rabbitvcs.util.helper.save_repository_path, url)
        self.action.append(
            self.svn.switch,
            self.path,
            url,
            revision=revision
        )
        self.action.append(self.action.set_status, _("Completed Switch"))
        self.action.append(self.action.finish)
        self.action.start()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNSwitch
}

def switch_factory(path, revision=None):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT
    (options, args) = main(
        [REVISION_OPT],
        usage="Usage: rabbitvcs switch [url]"
    )
            
    window = switch_factory(args[0], revision=options.revision)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 29
0
        context_menu = GtkContextMenu(self.structure, self.conditions, self.callbacks)
        context_menu.show(self.event)

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNChanges,
    rabbitvcs.vcs.VCS_GIT: GitChanges
}

def changes_factory(vcs, path1=None, revision1=None, path2=None, revision2=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path1)
        vcs = guess["vcs"]

    return classes_map[vcs](path1, revision1, path2, revision2)

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main(
        [VCS_OPT],
        usage="Usage: rabbitvcs changes [url1@rev1] [url2@rev2]"
    )

    pathrev1 = helper.parse_path_revision_string(args.pop(0))
    pathrev2 = (None, None)
    if len(args) > 0:
        pathrev2 = helper.parse_path_revision_string(args.pop(0))

    window = changes_factory(options.vcs, pathrev1[0], pathrev1[1], pathrev2[0], pathrev2[1])
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 30
0
                item["revision"][:7],
                item["author"],
                rabbitvcs.util.helper.format_datetime(item["date"]),
                item["line"]
            )
        
        return text

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNAnnotate,
    rabbitvcs.vcs.VCS_GIT: GitAnnotate
}

def annotate_factory(vcs, path, revision=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]
        
    return classes_map[vcs](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT], 
        usage="Usage: rabbitvcs annotate url [-r REVISION]"
    )

    window = annotate_factory(options.vcs, paths[0], options.revision)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 31
0
            remove_ignored_too,
            remove_only_ignored,
            dry_run,
            force
        )
        self.action.append(self.action.set_status, _("Completed Clean"))
        self.action.append(self.action.finish)
        self.action.start()

    def on_remove_ignored_too_toggled(self, widget):
        remove_ignored_too = self.get_widget("remove_ignored_too")
        remove_only_ignored = self.get_widget("remove_only_ignored")
        
        if remove_ignored_too.get_active():
            remove_only_ignored.set_active(False)

    def on_remove_only_ignored_toggled(self, widget):
        remove_ignored_too = self.get_widget("remove_ignored_too")
        remove_only_ignored = self.get_widget("remove_only_ignored")
        
        if remove_only_ignored.get_active():
            remove_ignored_too.set_active(False)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs clean path")
    
    window = GitClean(paths[0])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 32
0
            self.message.get_text()
        )
        self.action.append(self.action.set_status, _("Completed Commit"))
        self.action.append(self.action.finish)
        self.action.start()

    def on_files_table_toggle_event(self, row, col):
        # Adds path: True/False to the dict
        self.changes[row[1]] = row[col]

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNCommit, 
    rabbitvcs.vcs.VCS_GIT: GitCommit, 
    rabbitvcs.vcs.VCS_MERCURIAL: MercurialCommit
}

def commit_factory(paths, base_dir=None, message=None):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir, message)

if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main(
        [BASEDIR_OPT, (["-m", "--message"], {"help":"add a commit log message"})],
        usage="Usage: rabbitvcs commit [path1] [path2] ..."
    )

    window = commit_factory(paths, options.base_dir, message=options.message)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 33
0
        return all([
            detail["status"] != "unchanged"
            for (propname, detail) in list(self.propdetails.items())
        ])

    def all_not_deleted(self):
        return all([
            detail["status"] != "deleted"
            for (propname, detail) in list(self.propdetails.items())
        ])

    def property_revert(self):
        return False
        # return self.all_modified()

    def property_delete(self):
        return self.all_not_deleted()

    def property_edit(self):
        return len(list(self.propdetails.keys())) == 1


if __name__ == "__main__":
    # These are some dumb tests before I add any functionality.
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs propedit [url_or_path]")

    window = PropEditor(paths[0])
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 34
0
                self.action.append(self.git.fetch_all)
            else:
                self.action.append(self.git.fetch, repository, branch)

        self.action.append(self.action.set_status, _("Completed Update"))
        self.action.append(self.action.finish)
        self.action.schedule()


classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNUpdate,
    rabbitvcs.vcs.VCS_GIT: GitUpdate
}


def update_factory(paths):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths)


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options,
     paths) = main(usage="Usage: rabbitvcs update [path1] [path2] ...")

    window = update_factory(paths)
    window.register_gtk_quit()
    if isinstance(window, SVNUpdate):
        window.start()
    Gtk.main()
Ejemplo n.º 35
0
    """

    def __init__(self, path):
        InterfaceNonView.__init__(self)
        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

    def start(self):
        self.action = SVNAction(
            self.svn,
            register_gtk_quit=self.gtk_quit_is_set()
        )

        self.action.append(self.action.set_header, _("Cleanup"))
        self.action.append(self.action.set_status, _("Cleaning Up..."))
        self.action.append(self.svn.cleanup, self.path)
        self.action.append(self.action.set_status, _("Completed Cleanup"))
        self.action.append(self.action.finish)
        self.action.schedule()


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs cleanup [path]")

    window = SVNCleanup(paths[0])
    window.register_gtk_quit()
    window.start()
    Gtk.main()
Ejemplo n.º 36
0
        if not os.path.exists(dirname):
            os.mkdir(dirname)

        self.action.append(self.action.set_header, _("Rename"))
        self.action.append(self.action.set_status,
                           _("Running Rename Command..."))
        self.action.append(self.git.move, self.path, self.new_path)
        self.action.append(self.action.set_status, _("Completed Rename"))
        self.action.append(self.action.finish)
        self.action.append(self.close)
        self.action.schedule()


classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNRename,
    rabbitvcs.vcs.VCS_GIT: GitRename
}


def rename_factory(path):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path)


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs rename [path]")

    window = rename_factory(os.path.abspath(paths[0]))
    Gtk.main()
Ejemplo n.º 37
0

def changes_factory(vcs,
                    path1=None,
                    revision1=None,
                    path2=None,
                    revision2=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path1)
        vcs = guess["vcs"]

    return classes_map[vcs](path1, revision1, path2, revision2)


if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options,
     args) = main([VCS_OPT],
                  usage="Usage: rabbitvcs changes [url1@rev1] [url2@rev2]")

    pathrev1 = rabbitvcs.util.helper.parse_path_revision_string(args.pop(0))
    pathrev2 = (None, None)
    if len(args) > 0:
        pathrev2 = rabbitvcs.util.helper.parse_path_revision_string(
            args.pop(0))

    window = changes_factory(options.vcs, pathrev1[0], pathrev1[1],
                             pathrev2[0], pathrev2[1])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 38
0
        )
        self.action.append(self.action.set_status, _("Completed Reset"))
        self.action.append(self.action.finish)
        self.action.start()

    def on_browse_clicked(self, widget, data=None):
        chooser = rabbitvcs.ui.dialog.FolderChooser()
        path = chooser.run()
        if path is not None:
            self.get_widget("path").set_text(path)

    def on_path_changed(self, widget, data=None):
        self.check_path()

    def check_path(self):
        path = self.get_widget("path").get_text()
        root = self.git.find_repository_path(path)
        if root != path:
            self.get_widget("none_opt").set_active(True)    

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs reset [-r REVISION] path"
    )
    
    window = GitReset(paths[0], options.revision)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 39
0
            return

        context_menu = GtkContextMenu(self.structure, self.conditions,
                                      self.callbacks)
        context_menu.show(self.event)


classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNAnnotate,
    rabbitvcs.vcs.VCS_GIT: GitAnnotate
}


def annotate_factory(vcs, path, revision=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]

    return classes_map[vcs](path, revision)


if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options,
     paths) = main([REVISION_OPT, VCS_OPT],
                   usage="Usage: rabbitvcs annotate url [-r REVISION]")

    window = annotate_factory(options.vcs, paths[0], options.revision)
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 40
0

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNIgnore,
    rabbitvcs.vcs.VCS_GIT: GitIgnore
}


def ignore_factory(path, pattern):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path, pattern)


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, args) = main(usage="Usage: rabbitvcs ignore <folder> <pattern>")

    path = getcwd()
    pattern = ""
    if args:
        if len(args) == 1:
            pattern = args[0]
        else:
            if args[0] != ".":
                path = args[0]
            pattern = args[1]

    window = ignore_factory(path, pattern)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 41
0
    def on_treeview_cell_edited_event(self, cell, row, data, column):
        self.items_treeview.set_row_item(row, column, data)
        self.save(row, column, data)

    def on_treeview_event(self, treeview, data):
        selected = self.items_treeview.get_selected_row_items(0)
        if len(selected) > 0:
            if len(selected) == 1:
                self.show_edit(selected[0])
            self.get_widget("delete").set_sensitive(True)

    def show_add(self):
        self.state = STATE_ADD
        self.items_treeview.unselect_all()

        self.items_treeview.append(["", ""])
        self.items_treeview.focus(len(self.remote_list), 0)

    def show_edit(self, remote_name):
        self.state = STATE_EDIT


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs branch-manager path")

    window = GitRemotes(paths[0])
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 42
0
        # Adds path: True/False to the dict
        self.changes[row[1]] = row[col]


classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNCommit,
    rabbitvcs.vcs.VCS_GIT: GitCommit,
    rabbitvcs.vcs.VCS_MERCURIAL: MercurialCommit
}


def commit_factory(paths, base_dir=None, message=None):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir, message)


if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options,
     paths) = main([
         BASEDIR_OPT,
         (["-m", "--message"], {
             "help": "add a commit log message"
         })
     ],
                   usage="Usage: rabbitvcs commit [path1] [path2] ...")

    window = commit_factory(paths, options.base_dir, message=options.message)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 43
0
            self.svn,
            register_gtk_quit=self.gtk_quit_is_set()
        )
        
        self.action.append(self.action.set_header, _("Mark as Resolved"))
        self.action.append(self.action.set_status, _("Running Resolved Command..."))
        for item in items:
            self.action.append(self.svn.resolve, item, recurse=True)
        self.action.append(self.action.set_status, _("Completed Mark as Resolved"))
        self.action.append(self.action.finish)
        self.action.start()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNMarkResolved
}

def markresolved_factory(paths, base_dir=None):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir)
        
if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main(
        [BASEDIR_OPT],
        usage="Usage: rabbitvcs markresolved [path1] [path2] ..."
    )

    window = markresolved_factory(paths, options.base_dir)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 44
0
        )
        self.action.append(self.action.set_status, _("Completed Checkout"))
        self.action.append(self.action.finish)
        self.action.start()

    def on_revision_changed(self, revision_selector):
        pass

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNUpdateToRevision,
    rabbitvcs.vcs.VCS_GIT: GitUpdateToRevision,
}

def updateto_factory(vcs, path, revision=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]

    return classes_map[vcs](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, args) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs updateto [path]"
    )
 
    window = updateto_factory(options.vcs, args[0], revision=options.revision)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 45
0
            relative_path = path[len(repo_path)+1:]
        
        dest_path = "%s/%s" % (dest_dir, relative_path)
        
        rabbitvcs.util.helper.open_item(dest_path)

        raise SystemExit()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNOpen,
    rabbitvcs.vcs.VCS_GIT: GitOpen
}

def open_factory(vcs, path, revision):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]
        
    return classes_map[vcs](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs open path [-r REVISION]"
    )
    
    window = open_factory(options.vcs, paths[0], options.revision)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 46
0
    "Please Wait...".  Then when it finishes cleaning up, the label will 
    change to "Finished cleaning up /path/to/folder"
    
    """
    def __init__(self, path):
        InterfaceNonView.__init__(self)
        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

    def start(self):
        self.action = SVNAction(self.svn,
                                register_gtk_quit=self.gtk_quit_is_set())

        self.action.append(self.action.set_header, _("Cleanup"))
        self.action.append(self.action.set_status, _("Cleaning Up..."))
        self.action.append(self.svn.cleanup, self.path)
        self.action.append(self.action.set_status, _("Completed Cleanup"))
        self.action.append(self.action.finish)
        self.action.start()


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs cleanup [path]")

    window = SVNCleanup(paths[0])
    window.register_gtk_quit()
    window.start()
    gtk.main()
Ejemplo n.º 47
0
        self.git = self.vcs.git()
        self.path = path

        self.action = GitAction(
            self.git,
            register_gtk_quit=True
        )

        self.action.append(self.action.set_header, _("Initialize Repository"))
        self.action.append(self.action.set_status, _("Setting up repository..."))
        self.action.append(self.git.initialize_repository, self.path)
        self.action.append(self.action.set_status, _("Completed repository setup"))
        self.action.append(self.action.finish)
        self.action.schedule()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNCreate,
    rabbitvcs.vcs.VCS_GIT: GitCreate
}


if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT, VCS_OPT_ERROR
    (options, paths) = main([VCS_OPT], usage="Usage: rabbitvcs create --vcs [svn|git] path")
    if options.vcs:
        window = classes_map[options.vcs](paths[0])
        if options.vcs == rabbitvcs.vcs.VCS_GIT:
            Gtk.main()
    else:
        rabbitvcs.ui.dialog.MessageBox(VCS_OPT_ERROR)
Ejemplo n.º 48
0
            os.path.join(self.destination, append)
        )
        
        self.check_form()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNExport,
    rabbitvcs.vcs.VCS_GIT: GitExport
}

def export_factory(vcs, path, revision=None):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path)
        vcs = guess["vcs"]
    
    if vcs == rabbitvcs.vcs.VCS_DUMMY:
        vcs = rabbitvcs.vcs.VCS_SVN
        
    return classes_map[vcs](path, revision)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs export --vcs=[git|svn] [url_or_path]"
    )
            
    window = export_factory(options.vcs, paths[0], revision=options.revision)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 49
0
        Delete.__init__(self, paths)
    
    def vcs_remove(self, paths, **kwargs):
        if rabbitvcs.vcs.guess(paths[0])["vcs"] == rabbitvcs.vcs.VCS_SVN:
            self.vcs.svn().remove(paths, **kwargs)

class GitDelete(Delete):
    def __init__(self, paths):
        Delete.__init__(self, paths)
    
    def vcs_remove(self, paths, **kwargs):
        if rabbitvcs.vcs.guess(paths[0])["vcs"] == rabbitvcs.vcs.VCS_GIT:
            self.vcs.git(paths[0]).remove(paths)

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNDelete,
    rabbitvcs.vcs.VCS_GIT: GitDelete
}

def delete_factory(paths):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths)

if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs delete [path1] [path2] ...")

    window = delete_factory(paths)
    window.register_gtk_quit()
    window.start()
Ejemplo n.º 50
0
        
        for path in paths:
            self.action.append(self.git.stage, path)
        self.action.run()

classes_map = {
    rabbitvcs.vcs.VCS_GIT: GitStage
}

quiet_classes_map = {
    rabbitvcs.vcs.VCS_GIT: GitStageQuiet
}

def stage_factory(classes_map, paths, base_dir=None):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths, base_dir)

if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT, QUIET_OPT
    (options, paths) = main(
        [BASEDIR_OPT, QUIET_OPT],
        usage="Usage: rabbitvcs stage [path1] [path2] ..."
    )

    if options.quiet:
        stage_factory(quiet_classes_map, paths)
    else:
        window = stage_factory(classes_map, paths, options.base_dir)
        window.register_gtk_quit()
        gtk.main()
Ejemplo n.º 51
0
            self.tag_entry.set_text(self.selected_tag.name)
            self.revision_label.set_text(self.selected_tag.sha)
            self.message_label.set_text(self.selected_tag.message.rstrip("\n"))
            self.tagger_label.set_text(self.selected_tag.tagger)
            self.date_label.set_text(rabbitvcs.util.helper.format_datetime(datetime.fromtimestamp(self.selected_tag.tag_time)))

            self.show_containers(self.view_containers)
            self.get_widget("detail_label").set_markup(_("<b>Tag Detail</b>"))


    def on_log_dialog_button_clicked(self, widget):
        log_dialog_factory(
            self.path,
            ok_callback=self.on_log_dialog_closed
        )
    
    def on_log_dialog_closed(self, data):
        if data:
            self.start_point_entry.set_text(data)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT],
        usage="Usage: rabbitvcs tag-manager path"
    )
    
    window = GitTagManager(paths[0], options.revision)
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 52
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        rabbitvcs.util.helper.launch_merge_tool(self.path)
        
        self.close()

classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNEditConflicts,
    rabbitvcs.vcs.VCS_GIT: GitEditConflicts
}

def editconflicts_factory(path):
    guess = rabbitvcs.vcs.guess(path)
    return classes_map[guess["vcs"]](path)
        
if __name__ == "__main__":
    from rabbitvcs.ui import main, BASEDIR_OPT
    (options, paths) = main(
        [BASEDIR_OPT],
        usage="Usage: rabbitvcs edit-conflicts [path1] [path2] ..."
    )

    window = editconflicts_factory(paths[0])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 53
0
                row[1],
                self.revision_obj,
                force=True
            )

        for row in self.table.get_items():
            self.action.append(
                self.svn.revpropset,
                row[1],
                row[2],
                self.path,
                self.revision_obj,
                force=True
            )

        self.action.schedule()

        self.close()

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main(
        [VCS_OPT],
        usage="Usage: rabbitvcs revprops [url1@rev1]"
    )

    pathrev = rabbitvcs.util.helper.parse_path_revision_string(args.pop(0))
    window = SVNRevisionProperties(pathrev[0], pathrev[1])
    window.register_gtk_quit()
    Gtk.main()
Ejemplo n.º 54
0
            self.git, register_gtk_quit=self.gtk_quit_is_set())
        self.action.set_pbar_ticks(ticks)
        self.action.append(self.action.set_header, _("Apply Patch"))
        self.action.append(self.action.set_status, _("Applying Patch File..."))
        self.action.append(self.git.apply_patch, path, base_dir)
        self.action.append(self.action.set_status, _("Patch File Applied"))
        self.action.append(self.action.finish)
        self.action.schedule()


classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNApplyPatch,
    rabbitvcs.vcs.VCS_GIT: GitApplyPatch
}


def applypatch_factory(paths):
    guess = rabbitvcs.vcs.guess(paths[0])
    return classes_map[guess["vcs"]](paths)


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options,
     paths) = main(usage="Usage: rabbitvcs applypatch [path1] [path2] ...")

    window = applypatch_factory(paths)
    window.register_gtk_quit()
    window.start()
    Gtk.main()
Ejemplo n.º 55
0
classes_map = {
    rabbitvcs.vcs.VCS_SVN: SVNDiff,
    rabbitvcs.vcs.VCS_GIT: GitDiff
}

def diff_factory(vcs, path1, revision_obj1, path2=None, revision_obj2=None, sidebyside=False):
    if not vcs:
        guess = rabbitvcs.vcs.guess(path1)
        vcs = guess["vcs"]

    return classes_map[vcs](path1, revision_obj1, path2, revision_obj2, sidebyside)

if __name__ == "__main__":
    from rabbitvcs.ui import main, VCS_OPT
    (options, args) = main([
        (["-s", "--sidebyside"], {
            "help":     _("View diff as side-by-side comparison"), 
            "action":   "store_true", 
            "default":  False
        }), VCS_OPT],
        usage="Usage: rabbitvcs diff [url1@rev1] [url2@rev2]"
    )
    
    pathrev1 = rabbitvcs.util.helper.parse_path_revision_string(args.pop(0))
    pathrev2 = (None, None)
    if len(args) > 0:
        pathrev2 = rabbitvcs.util.helper.parse_path_revision_string(args.pop(0))

    diff_factory(options.vcs, pathrev1[0], pathrev1[1], pathrev2[0], pathrev2[1], sidebyside=options.sidebyside)
Ejemplo n.º 56
0
                           self.path,
                           url,
                           self.message.get_text(),
                           ignore=ignore)
        self.action.append(self.action.set_status, _("Completed Import"))
        self.action.append(self.action.finish)
        self.action.start()

    def on_previous_messages_clicked(self, widget, data=None):
        dialog = rabbitvcs.ui.dialog.PreviousMessages()
        message = dialog.run()
        if message is not None:
            self.message.set_text(message)


classes_map = {rabbitvcs.vcs.VCS_SVN: SVNImport}


def import_factory(path):
    vcs = rabbitvcs.vcs.VCS_SVN
    return classes_map[vcs](path)


if __name__ == "__main__":
    from rabbitvcs.ui import main
    (options, paths) = main(usage="Usage: rabbitvcs import [path]")

    window = import_factory(paths[0])
    window.register_gtk_quit()
    gtk.main()
Ejemplo n.º 57
0
        if self.selected_branch.tracking:
            self.checkout_checkbox.set_active(True)
            self.checkout_checkbox.set_sensitive(False)
        else:
            self.checkout_checkbox.set_active(False)
            self.checkout_checkbox.set_sensitive(True)

        self.show_containers(self.view_containers)
        self.get_widget("detail_label").set_markup(_("<b>Branch Detail</b>"))

    def on_log_dialog_button_clicked(self, widget):
        log_dialog_factory(
            self.path,
            ok_callback=self.on_log_dialog_closed
        )
    
    def on_log_dialog_closed(self, data):
        if data:
            self.start_point_entry.set_text(data)

if __name__ == "__main__":
    from rabbitvcs.ui import main, REVISION_OPT, VCS_OPT
    (options, paths) = main(
        [REVISION_OPT, VCS_OPT], 
        usage="Usage: rabbitvcs branch-manager path [-r revision]"
    )
    
    window = GitBranchManager(paths[0], revision=options.revision)
    window.register_gtk_quit()
    gtk.main()