Bk export omits changes to BitKeeper/etc/ignore


#1

One of our users was distressed by:

username@machine:/home/username/work/cornet/2$ bk export -tpatch -r$(bk repogca)..
gnupatch: no revs on stdin
username@machine:/home/username/work/cornet/2$ 

Poking around with strace and (yay!) the source, I see that what we might want is:

username@machine:/home/username/work/cornet/2$ bk rset -Hhr$(bk repogca).. | bk gnupatch -du
diff -Nru a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore
--- a/BitKeeper/etc/ignore	2016-12-09 19:09:43 +00:00
+++ b/BitKeeper/etc/ignore	2016-12-09 19:09:43 +00:00
@@ -102,3 +102,6 @@
 tools/mc/message.rc
 tools/ndmputil/src/readme.txt
 ~$*
+GPATH
+GRTAGS
+GTAGS
username@machine:/home/username/work/cornet/2$ 

I suspect that we might be falling foul of some code in export.c intended to drop deletes:

	/*
	 * Skip BitKeeper/ files (but pass deletes..)
  	 *
	 * Email Note from Wayne Scott:
	 * In general the only changes to files in the deleted
	 * directory are when they are moved to that directory. 
	 * This code requires that its starting location or the ending
	 * location must be outside of bitkeeper.  We don't need
	 * patches with changes for files that are deleted. We just
	 * need the patch to have the delete.
	 */

I suspect it shouldn’t be skipping BitKeeper files if the undocumented -a is passed:

if (opts->sysfiles) {
	rav = addLine(rav, strdup("-a"));
} else {
	rav = addLine(rav, strdup("--hide-bk"));
}

Bk-7.3.2 released 2017-09-23
#2

Agreed. It appears that -a is not setup to work correctly with -tpatch but only with the original -tplain.

Also, it appears we have a but where that code doesn’t handle empty csets very well. I will need to setup a testcase for this.

Out of town at the moment so that will have to wait.


#3

Fixed in bk-7.3.2