Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

Re: lug-bg: cvs log date format


  • Subject: Re: lug-bg: cvs log date format
  • From: Peter Pentchev <roam@xxxxxxxxxxx>
  • Date: Wed, 1 Sep 2004 15:20:44 +0300

On Wed, Sep 01, 2004 at 02:08:54PM +0300, George Danchev wrote:
[snip]
> Според мен FreeBSD port maintainer/commiter-a е добре да предложи тази
> промяна в stock/upstream кода на CVS.

Всъщност CVS във FreeBSD не е порт, а е част от base system :)  Ако се
интересуваш, това, което DES направи с commit-а си на 6 юли 2004, беше
следното съвсем простичко нещо (като дори можеш да игнорираш първия
chunk, който добавя задължителното за FreeBSD source repository тагче
$FreeBSD$, което се държи като $Id$):

Index: src/contrib/cvs/src/log.c
===================================================================
RCS file: /home/ncvs/src/contrib/cvs/src/log.c,v
retrieving revision 1.1.1.12
retrieving revision 1.2
diff -u -r1.1.1.12 -r1.2
--- src/contrib/cvs/src/log.c	10 Jun 2004 19:05:37 -0000	1.1.1.12
+++ src/contrib/cvs/src/log.c	6 Jul 2004 08:10:38 -0000	1.2
@@ -10,6 +10,8 @@
  * Prints the RCS "log" (rlog) information for the specified files.  With no
  * argument, prints the log information for all the files in the directory
  * (recursive by default).
+ *
+ * $FreeBSD$
  */
 
 #include "cvs.h"
@@ -1605,8 +1607,8 @@
 		   &sec);
     if (year < 1900)
 	year += 1900;
-    sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday,
-	     hour, min, sec);
+    sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d",
+	     year, datesep, mon, datesep, mday, hour, min, sec);
     cvs_output (buf, 0);
 
     cvs_output (";  author: ", 0);
Index: src/contrib/cvs/src/main.c
===================================================================
RCS file: /home/ncvs/src/contrib/cvs/src/main.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- src/contrib/cvs/src/main.c	15 Apr 2004 01:17:27 -0000	1.24
+++ src/contrib/cvs/src/main.c	6 Jul 2004 08:10:38 -0000	1.25
@@ -1237,6 +1237,9 @@
 	    if (q)
 		*q = '\0';
 
+	    if (!strcmp(buf, "iso8601")) {
+		datesep = '-';
+	    }
 	    if (!strncmp(buf, "tag=", 4)) {
 		char *what;
 		char *rcs_localid;
Index: src/contrib/cvs/src/rcs.c
===================================================================
RCS file: /home/ncvs/src/contrib/cvs/src/rcs.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- src/contrib/cvs/src/rcs.c	15 Apr 2004 01:17:27 -0000	1.26
+++ src/contrib/cvs/src/rcs.c	6 Jul 2004 08:10:38 -0000	1.27
@@ -26,6 +26,7 @@
 # endif
 #endif
 
+int datesep = '/';
 int preserve_perms = 0;
 
 /* The RCS -k options, and a set of enums that must match the array.
@@ -3549,8 +3550,8 @@
 		   &sec);
     if (year < 1900)
 	year += 1900;
-    sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday,
-	     hour, min, sec);
+    sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d",
+	     year, datesep, mon, datesep, mday, hour, min, sec);
     return xstrdup (buf);
 }
 
Index: src/contrib/cvs/src/rcs.h
===================================================================
RCS file: /home/ncvs/src/contrib/cvs/src/rcs.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- src/contrib/cvs/src/rcs.h	15 Apr 2004 01:17:27 -0000	1.10
+++ src/contrib/cvs/src/rcs.h	6 Jul 2004 08:10:38 -0000	1.11
@@ -250,6 +250,7 @@
 void RCS_setlocalid PROTO ((const char *arg));
 char *make_file_label PROTO ((const char *, const char *, RCSNode *));
 
+extern int datesep;
 extern int preserve_perms;
 
 /* From import.c.  */

Поздрави,
Петър

-- 
Peter Pentchev	roam@xxxxxxxxxxx    roam@xxxxxxxx    roam@xxxxxxxxxxx
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
I am the thought you are now thinking.

Attachment: pgpk2Hc_KCN5M.pgp
Description: PGP signature



 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.