1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4
* Copyright (C) William Fagan 2008
6
* Portions based on the Subversion plugin
7
* Copyright (C) James Liggett 2007
8
* Copyright (C) Johannes Schmid 2005
10
* Anjuta is free software.
12
* You may redistribute it and/or modify it under the terms of the
13
* GNU General Public License, as published by the Free Software
14
* Foundation; either version 2 of the License, or (at your option)
17
* Anjuta is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
* See the GNU General Public License for more details.
22
* You should have received a copy of the GNU General Public License
23
* along with Anjuta. If not, write to:
24
* The Free Software Foundation, Inc.,
25
* 51 Franklin Street, Fifth Floor
26
* Boston, MA 02110-1301, USA.
30
#include "bzr-bind-cmd.h"
31
#include "bazaar-tools-etc.h"
33
struct _BzrBindCmdPriv
38
G_DEFINE_TYPE (BzrBindCmd, bzr_bind_cmd, BZR_TYPE_CMD);
41
bzr_bind_cmd_init (BzrBindCmd *self)
43
self->priv = g_new0 (BzrBindCmdPriv, 1);
47
bzr_bind_cmd_new (const gchar *working_dir, const gchar *branch)
51
self = g_object_new (BZR_TYPE_BIND_CMD, "working-directory", working_dir, NULL);
53
self->priv->branch = g_strdup (branch);
59
bzr_bind_cmd_finalize (GObject *object)
61
BzrBindCmd *command = NULL;
63
command = BZR_BIND_CMD (object);
65
g_free (command->priv->branch);
66
g_free (command->priv);
68
G_OBJECT_CLASS (bzr_bind_cmd_parent_class)->finalize (object);
72
bzr_bind_cmd_run (AnjutaCommand *command)
74
BzrBindCmd *self = NULL;
76
self = BZR_BIND_CMD (command);
78
bzr_cmd_add_arg (BZR_CMD (self), "bind");
80
bzr_cmd_add_arg (BZR_CMD (self), self->priv->branch);
86
bzr_bind_cmd_class_init (BzrBindCmdClass *klass)
88
GObjectClass *object_class = NULL;
89
AnjutaCommandClass *command_class = NULL;
91
object_class = G_OBJECT_CLASS (klass);
92
command_class = ANJUTA_COMMAND_CLASS (klass);
94
object_class->finalize = bzr_bind_cmd_finalize;
95
command_class->run = bzr_bind_cmd_run;
99
bzr_bind_cmd_destroy (BzrBindCmd *self)
101
g_object_unref (self);
105
bzr_bind_cmd_finished (AnjutaCommand *command, guint return_code,
108
g_object_unref (command);
111
void bzr_bind_cmd_execute (const gchar *working_dir, const gchar *branch)
113
BzrBindCmd *cmd = NULL;
115
cmd = bzr_bind_cmd_new (working_dir, branch);
117
g_signal_connect (G_OBJECT (cmd), "command-finished",
118
G_CALLBACK (bzr_bind_cmd_finished), NULL);
120
anjuta_command_start (ANJUTA_COMMAND (cmd));