Merge branch 'cvsserver' of http://locke.catalyst.net.nz/git/git-martinlanghoff;...
authorJunio C Hamano <junkio@cox.net>
Wed, 1 Mar 2006 09:33:23 +0000 (01:33 -0800)
committerJunio C Hamano <junkio@cox.net>
Wed, 1 Mar 2006 09:33:23 +0000 (01:33 -0800)
Conflicts:

Documentation/git-cvsserver.txt
git-cvsserver.perl

Originally Martin's tree was based on "next", which meant that all
the other things that I am not ready to push out to "master" were
contained in it.  His changes looked good, and I wanted to have them
in "master".

So, here is what I did:

 - fetch Martin's tree into a temporary topic branch.
   $ git fetch $URL $remote:ml/cvsserver
   $ git checkout ml/cvsserver

 - rebase it on top of "master".
   $ git rebase --onto master next

 - pull that master into "next", recording Martin's head as well.
   $ git pull --append . master

Since I have apply.whitespace=strip in my configuration file, the
rebased cvsserver changes have trailing whitespaces introduced by
Martin's tree cleansed out.  Hence the above conflicts.

The reason I made this octopus is to make sure that next time Martin
pulls from my "next" branch, it results in a fast forward.  There is
no reason to force him do the same conflict resolution I did with this
merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-cvsserver.txt
Makefile
contrib/gitview/gitview
diffcore-break.c
git-cvsserver.perl

index 88f07ff..19c9c51 100644 (file)
@@ -54,6 +54,30 @@ INSTALLATION
    of branches in git).
      $ cvs co -d mylocaldir master
 
+Eclipse CVS Client Notes
+------------------------
+
+To get a checkout with the Eclipse CVS client:
+
+1. Create a new project from CVS checkout, giving it repository and module
+2. Context Menu->Team->Share Project...
+3. Enter the repository and module information again and click Finish
+4. The Synchronize view appears. Untick  "launch commit wizard" to avoid
+committing the .project file, and select HEAD as the tag to synchronize to.
+Update all incoming changes.
+
+Note that most versions of Eclipse ignore CVS_SERVER (which you can set in
+the Preferences->Team->CVS->ExtConnection pane), so you may have to
+rename, alias or symlink git-cvsserver to 'cvs' on the server.
+
+Clients known to work
+---------------------
+
+CVS 1.12.9 on Debian
+CVS 1.11.17 on MacOSX (from Fink package)
+Eclipse 3.0, 3.1.2 on MacOSX (see Eclipse CVS Client Notes)
+TortoiseCVS
+
 Operations supported
 --------------------
 
index 5e93f27..26ef1f8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -223,11 +223,15 @@ ifeq ($(uname_S),Darwin)
        NEEDS_SSL_WITH_CRYPTO = YesPlease
        NEEDS_LIBICONV = YesPlease
        ## fink
-       ALL_CFLAGS += -I/sw/include
-       ALL_LDFLAGS += -L/sw/lib
+       ifeq ($(shell test -d /sw/lib && echo y),y)
+               ALL_CFLAGS += -I/sw/include
+               ALL_LDFLAGS += -L/sw/lib
+       endif
        ## darwinports
-       ALL_CFLAGS += -I/opt/local/include
-       ALL_LDFLAGS += -L/opt/local/lib
+       ifeq ($(shell test -d /opt/local/lib && echo y),y)
+               ALL_CFLAGS += -I/opt/local/include
+               ALL_LDFLAGS += -L/opt/local/lib
+       endif
 endif
 ifeq ($(uname_S),SunOS)
        NEEDS_SOCKET = YesPlease
index 048caf6..ea05cd4 100755 (executable)
@@ -239,20 +239,23 @@ class CellRendererGraph(gtk.GenericCellRenderer):
                                box_size / 4, 0, 2 * math.pi)
 
 
+               self.set_colour(ctx, colour, 0.0, 0.5)
+               ctx.stroke_preserve()
+
+               self.set_colour(ctx, colour, 0.5, 1.0)
+               ctx.fill_preserve()
+
                if (len(names) != 0):
                        name = " "
                        for item in names:
                                name = name + item + " "
 
-                       ctx.select_font_face("Monospace")
                        ctx.set_font_size(13)
-                       ctx.text_path(name)
-
-               self.set_colour(ctx, colour, 0.0, 0.5)
-               ctx.stroke_preserve()
-
-               self.set_colour(ctx, colour, 0.5, 1.0)
-               ctx.fill()
+                       if (flags & 1):
+                               self.set_colour(ctx, colour, 0.5, 1.0)
+                       else:
+                               self.set_colour(ctx, colour, 0.0, 0.5)
+                       ctx.show_text(name)
 
 class Commit:
        """ This represent a commit object obtained after parsing the git-rev-list
@@ -365,7 +368,7 @@ class DiffWindow:
                save_menu.connect("activate", self.save_menu_response, "save")
                save_menu.show()
                menu_bar.append(save_menu)
-               vbox.pack_start(menu_bar, False, False, 2)
+               vbox.pack_start(menu_bar, expand=False, fill=True)
                menu_bar.show()
 
                scrollwin = gtk.ScrolledWindow()
@@ -479,19 +482,10 @@ class GitView:
 
        def construct(self):
                """Construct the window contents."""
+               vbox = gtk.VBox()
                paned = gtk.VPaned()
                paned.pack1(self.construct_top(), resize=False, shrink=True)
                paned.pack2(self.construct_bottom(), resize=False, shrink=True)
-               self.window.add(paned)
-               paned.show()
-
-
-       def construct_top(self):
-               """Construct the top-half of the window."""
-               vbox = gtk.VBox(spacing=6)
-               vbox.set_border_width(12)
-               vbox.show()
-
                menu_bar = gtk.MenuBar()
                menu_bar.set_pack_direction(gtk.PACK_DIRECTION_RTL)
                help_menu = gtk.MenuItem("Help")
@@ -503,8 +497,20 @@ class GitView:
                help_menu.set_submenu(menu)
                help_menu.show()
                menu_bar.append(help_menu)
-               vbox.pack_start(menu_bar, False, False, 2)
                menu_bar.show()
+               vbox.pack_start(menu_bar, expand=False, fill=True)
+               vbox.pack_start(paned, expand=True, fill=True)
+               self.window.add(vbox)
+               paned.show()
+               vbox.show()
+
+
+       def construct_top(self):
+               """Construct the top-half of the window."""
+               vbox = gtk.VBox(spacing=6)
+               vbox.set_border_width(12)
+               vbox.show()
+
 
                scrollwin = gtk.ScrolledWindow()
                scrollwin.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
@@ -520,6 +526,9 @@ class GitView:
                self.treeview.show()
 
                cell = CellRendererGraph()
+               #  Set the default width to 265
+               #  This make sure that we have nice display with large tag names
+               cell.set_property("width", 265)
                column = gtk.TreeViewColumn()
                column.set_resizable(True)
                column.pack_start(cell, expand=True)
index c57513a..95b5eb4 100644 (file)
@@ -58,6 +58,10 @@ static int should_break(struct diff_filespec *src,
        if (!S_ISREG(src->mode) || !S_ISREG(dst->mode))
                return 0; /* leave symlink rename alone */
 
+       if (src->sha1_valid && dst->sha1_valid &&
+           !memcmp(src->sha1, dst->sha1, 20))
+               return 0; /* they are the same */
+
        if (diff_populate_filespec(src, 0) || diff_populate_filespec(dst, 0))
                return 0; /* error but caught downstream */
 
index d20d1a8..3c588c9 100755 (executable)
@@ -53,6 +53,7 @@ my $methods = {
     'Entry'           => \&req_Entry,
     'Modified'        => \&req_Modified,
     'Unchanged'       => \&req_Unchanged,
+    'Questionable'    => \&req_Questionable,
     'Argument'        => \&req_Argument,
     'Argumentx'       => \&req_Argument,
     'expand-modules'  => \&req_expandmodules,
@@ -63,6 +64,7 @@ my $methods = {
     'ci'              => \&req_ci,
     'diff'            => \&req_diff,
     'log'             => \&req_log,
+    'rlog'            => \&req_log,
     'tag'             => \&req_CATCHALL,
     'status'          => \&req_status,
     'admin'           => \&req_CATCHALL,
@@ -459,6 +461,22 @@ sub req_Unchanged
     #$log->debug("req_Unchanged : $data");
 }
 
+# Questionable filename \n
+#     Response expected: no. Additional data: no.
+#     Tell the server to check whether filename should be ignored,
+#     and if not, next time the server sends responses, send (in
+#     a M response) `?' followed by the directory and filename.
+#     filename must not contain `/'; it needs to be a file in the
+#     directory named by the most recent Directory request.
+sub req_Questionable
+{
+    my ( $cmd, $data ) = @_;
+
+    $state->{entries}{$state->{directory}.$data}{questionable} = 1;
+
+    #$log->debug("req_Questionable : $data");
+}
+
 # Argument text \n
 #     Response expected: no. Save argument for use in a subsequent command.
 #     Arguments accumulate until an argument-using command is given, at which
@@ -568,7 +586,7 @@ sub req_co
 
         # print some information to the client
         print "MT +updated\n";
-        print "MT text U\n";
+        print "MT text U \n";
         if ( defined ( $git->{dir} ) and $git->{dir} ne "./" )
         {
             print "MT fname $checkout_path/$git->{dir}$git->{name}\n";
@@ -579,9 +597,9 @@ sub req_co
         print "MT -updated\n";
 
         # instruct client we're sending a file to put in this path
-        print "Created $checkout_path/" . ( defined ( $git->{dir} ) ? $git->{dir} . "/" : "" ) . "\n";
+        print "Created $checkout_path/" . ( defined ( $git->{dir} ) and $git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "\n";
 
-        print $state->{CVSROOT} . "/$module/" . ( defined ( $git->{dir} ) ? $git->{dir} . "/" : "" ) . "$git->{name}\n";
+        print $state->{CVSROOT} . "/$module/" . ( defined ( $git->{dir} ) and $git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "$git->{name}\n";
 
         # this is an "entries" line
         print "/$git->{name}/1.$git->{revision}///\n";
@@ -612,6 +630,26 @@ sub req_update
 
     argsplit("update");
 
+    #
+    # It may just be a client exploring the available heads/modukles
+    # in that case, list them as top level directories and leave it
+    # at that. Eclipse uses this technique to offer you a list of
+    # projects (heads in this case) to checkout.
+    #
+    if ($state->{module} eq '') {
+        print "E cvs update: Updating .\n";
+       opendir HEADS, $state->{CVSROOT} . '/refs/heads';
+       while (my $head = readdir(HEADS)) {
+           if (-f $state->{CVSROOT} . '/refs/heads/' . $head) {
+               print "E cvs update: New directory `$head'\n";
+           }
+       }
+       closedir HEADS;
+       print "ok\n";
+       return 1;
+    }
+
+
     # Grab a handle to the SQLite db and do any necessary updates
     my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log);