monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] monotone "diff" format


From: Neil Conway
Subject: [Monotone-devel] monotone "diff" format
Date: Wed, 27 Oct 2004 11:57:32 +1000

The format of the patches generated by "monotone diff" is slightly
different than the patches produced by diff(1). For example:

[neilc:/home/neilc/mainline]% monotone diff | patch -p0 -R
patching file src/backend/postmaster/pgstat.c
Hunk #3 succeeded at 683 (offset 1 line).
Hunk #4 succeeded at 989 (offset 1 line).
Hunk #5 succeeded at 1103 (offset 1 line).
Hunk #6 succeeded at 1142 (offset -4 lines).
Hunk #7 succeeded at 1174 (offset -6 lines).
Hunk #8 succeeded at 1523 (offset -6 lines).
Hunk #9 succeeded at 1796 (offset -8 lines).
[ ... ]

In comparing the patches produced by monotone diff and diff(1), it seems
the line numbers of subsequent chunks in the monotone patch aren't being
correctly updated for the lines that have been added/removed in earlier
chunks. For example, the first three chunks in the patch produced by
diff(1) are:

--- ../mainline2/src/backend/postmaster/pgstat.c        2004-10-27 11:26:44
+10:00
+++ ./src/backend/postmaster/pgstat.c   2004-10-27 11:27:05 +10:00
@@ -42,6 +42,7 @@
 #include "miscadmin.h"
 #include "postmaster/postmaster.h"
 #include "storage/backendid.h"
+#include "storage/fd.h"
 #include "storage/ipc.h"
 #include "storage/pg_shmem.h"
 #include "storage/pmsignal.h"
@@ -118,6 +119,7 @@
 
 static bool pgStatRunningInCollector = FALSE;
 
+static MemoryContext tabstatCxt = NULL;
 static int     pgStatTabstatAlloc = 0;
 static int     pgStatTabstatUsed = 0;
 static PgStat_MsgTabstat **pgStatTabstatMessages = NULL;
@@ -682,7 +684,7 @@
 /* ----------
  * pgstat_report_activity() -
  *
- *     Called in tcop/postgres.c to tell the collector what the backend
+ *     Called from tcop/postgres.c to tell the collector what the backend
  *     is actually doing (usually "<IDLE>" or the start of the query to
  *     be executed).
  * ----------

Whereas the first three chunks produced by monotone are:

--- src/backend/postmaster/pgstat.c
+++ src/backend/postmaster/pgstat.c
@@ -42,6 +42,7 @@
 #include "miscadmin.h"
 #include "postmaster/postmaster.h"
 #include "storage/backendid.h"
+#include "storage/fd.h"
 #include "storage/ipc.h"
 #include "storage/pg_shmem.h"
 #include "storage/pmsignal.h"
@@ -118,6 +119,7 @@
 
 static bool pgStatRunningInCollector = FALSE;
 
+static MemoryContext tabstatCxt = NULL;
 static int     pgStatTabstatAlloc = 0;
 static int     pgStatTabstatUsed = 0;
 static PgStat_MsgTabstat **pgStatTabstatMessages = NULL;
@@ -682,7 +683,7 @@
 /* ----------
  * pgstat_report_activity() -
  *
- *     Called in tcop/postgres.c to tell the collector what the backend
+ *     Called from tcop/postgres.c to tell the collector what the backend
  *     is actually doing (usually "<IDLE>" or the start of the query to
  *     be executed).
  * ----------

(Notice the "683" rather than "684"). This inaccuracy incrementally
increases in each chunk of the patch. Let me know if you need any more
information to reproduce this.

I think the current behavior is pretty harmless, but it would be nice if
I could get patch(1) to stop complaining :-)

-Neil






reply via email to

[Prev in Thread] Current Thread [Next in Thread]