Artifact
67a7890b6d5fc7294bc87d2787b9b758a143c3e6edf16191ad19de1a3140d181 :
Executable file
bin/backup-routers
— part of check-in
[6404badd21]
at
2023-01-13 14:34:37
on branch trunk
— The step in backup-routers that checks for substantial changes in the
diff was looking only for additions, not for elisions. If there are
*only* elisions in the diff — as when transitioning from the testing
channel back to the default, stable channel — then it will consider
there to be no substantial changes at all. We *do* want such diffs to
trigger a commit.
(user:
tangent
size: 3663)
0000: 23 21 2f 62 69 6e 2f 62 61 73 68 0a 0a 23 20 55 #!/bin/bash..# U
0010: 73 65 72 2d 63 6f 6e 66 69 67 75 72 61 62 6c 65 ser-configurable
0020: 73 0a 72 64 69 72 3d 7e 2f 6d 75 73 65 75 6d 0a s.rdir=~/museum.
0030: 72 65 70 6f 3d 24 72 64 69 72 2f 72 6f 75 74 65 repo=$rdir/route
0040: 72 6f 73 2d 62 61 63 6b 75 70 73 2e 66 6f 73 73 ros-backups.foss
0050: 69 6c 0a 62 64 69 72 3d 7e 2f 72 6f 75 74 65 72 il.bdir=~/router
0060: 6f 73 2d 62 61 63 6b 75 70 73 0a 0a 23 20 4d 61 os-backups..# Ma
0070: 6b 65 20 62 61 63 6b 75 70 20 63 68 65 63 6b 6f ke backup checko
0080: 75 74 20 64 69 72 65 63 74 6f 72 79 20 69 66 20 ut directory if
0090: 69 74 20 64 6f 65 73 6e 27 74 20 65 78 69 73 74 it doesn't exist
00a0: 20 61 6c 72 65 61 64 79 2e 0a 6d 6b 64 69 72 20 already..mkdir
00b0: 2d 70 20 24 62 64 69 72 0a 63 64 20 24 62 64 69 -p $bdir.cd $bdi
00c0: 72 0a 0a 23 20 50 72 65 70 61 72 65 20 46 6f 73 r..# Prepare Fos
00d0: 73 69 6c 20 72 65 70 6f 73 69 74 6f 72 79 20 61 sil repository a
00e0: 6e 64 2f 6f 72 20 63 68 65 63 6b 6f 75 74 20 61 nd/or checkout a
00f0: 73 20 6e 65 63 65 73 73 61 72 79 2e 0a 69 66 20 s necessary..if
0100: 21 20 5b 20 2d 72 20 2e 66 73 6c 63 6b 6f 75 74 ! [ -r .fslckout
0110: 20 5d 0a 74 68 65 6e 0a 20 20 20 20 6d 6b 64 69 ].then. mkdi
0120: 72 20 2d 70 20 24 72 64 69 72 0a 20 20 20 20 69 r -p $rdir. i
0130: 66 20 21 20 5b 20 2d 72 20 24 72 65 70 6f 20 5d f ! [ -r $repo ]
0140: 20 0a 20 20 20 20 74 68 65 6e 0a 20 20 20 20 20 . then.
0150: 20 20 20 66 6f 73 73 69 6c 20 69 6e 69 74 20 5c fossil init \
0160: 0a 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d 70 . --p
0170: 72 6f 6a 65 63 74 2d 6e 61 6d 65 20 72 6f 75 74 roject-name rout
0180: 65 72 6f 73 2d 62 61 63 6b 75 70 73 20 5c 0a 20 eros-backups \.
0190: 20 20 20 20 20 20 20 20 20 20 20 2d 2d 70 72 6f --pro
01a0: 6a 65 63 74 2d 64 65 73 63 20 22 52 6f 75 74 65 ject-desc "Route
01b0: 72 4f 53 20 63 6f 6e 66 69 67 75 72 61 74 69 6f rOS configuratio
01c0: 6e 20 62 61 63 6b 75 70 73 22 20 5c 0a 20 20 20 n backups" \.
01d0: 20 20 20 20 20 20 20 20 20 24 72 65 70 6f 0a 20 $repo.
01e0: 20 20 20 66 69 0a 20 20 20 20 66 6f 73 73 69 6c fi. fossil
01f0: 20 6f 70 65 6e 20 2d 2d 66 6f 72 63 65 20 24 72 open --force $r
0200: 65 70 6f 0a 20 20 20 20 69 66 20 21 20 5b 20 2d epo. if ! [ -
0210: 64 20 2e 66 6f 73 73 69 6c 2d 73 65 74 74 69 6e d .fossil-settin
0220: 67 73 20 5d 0a 20 20 20 20 74 68 65 6e 0a 20 20 gs ]. then.
0230: 20 20 20 20 20 20 23 20 54 65 6c 6c 20 46 6f 73 # Tell Fos
0240: 73 69 6c 20 6e 6f 74 20 74 6f 20 73 71 75 61 77 sil not to squaw
0250: 6b 20 61 62 6f 75 74 20 62 69 6e 61 72 79 20 64 k about binary d
0260: 61 74 61 20 69 6e 20 74 68 65 20 62 69 6e 61 72 ata in the binar
0270: 79 0a 20 20 20 20 20 20 20 20 23 20 62 61 63 6b y. # back
0280: 75 70 20 66 69 6c 65 73 20 6e 6f 72 20 43 52 4c up files nor CRL
0290: 46 73 20 69 6e 20 74 68 65 20 74 65 78 74 20 62 Fs in the text b
02a0: 61 63 6b 75 70 20 66 69 6c 65 73 2e 0a 20 20 20 ackup files..
02b0: 20 20 20 20 20 6d 6b 64 69 72 20 2e 66 6f 73 73 mkdir .foss
02c0: 69 6c 2d 73 65 74 74 69 6e 67 73 0a 20 20 20 20 il-settings.
02d0: 20 20 20 20 65 63 68 6f 20 27 2a 2f 2a 2e 72 73 echo '*/*.rs
02e0: 63 27 20 3e 20 2e 66 6f 73 73 69 6c 2d 73 65 74 c' > .fossil-set
02f0: 74 69 6e 67 73 2f 63 72 6c 66 2d 67 6c 6f 62 0a tings/crlf-glob.
0300: 20 20 20 20 20 20 20 20 65 63 68 6f 20 27 2a 2f echo '*/
0310: 2a 2e 62 69 6e 27 20 3e 20 2e 66 6f 73 73 69 6c *.bin' > .fossil
0320: 2d 73 65 74 74 69 6e 67 73 2f 62 69 6e 61 72 79 -settings/binary
0330: 2d 67 6c 6f 62 0a 20 20 20 20 20 20 20 20 66 6f -glob. fo
0340: 73 73 69 6c 20 61 64 64 20 2e 66 6f 73 73 69 6c ssil add .fossil
0350: 2d 73 65 74 74 69 6e 67 73 0a 20 20 20 20 66 69 -settings. fi
0360: 0a 66 69 0a 0a 23 20 44 65 66 61 75 6c 74 20 75 .fi..# Default u
0370: 73 61 67 65 3a 20 70 61 73 73 20 61 6c 6c 20 68 sage: pass all h
0380: 6f 73 74 6e 61 6d 65 73 20 67 6c 65 61 6e 65 64 ostnames gleaned
0390: 20 66 72 6f 6d 20 73 75 62 64 69 72 65 63 74 6f from subdirecto
03a0: 72 69 65 73 20 69 6e 0a 23 20 46 6f 73 73 69 6c ries in.# Fossil
03b0: 20 63 68 65 63 6b 6f 75 74 20 74 6f 20 6f 75 72 checkout to our
03c0: 73 65 6c 66 2e 0a 69 66 20 5b 20 2d 7a 20 22 24 self..if [ -z "$
03d0: 31 22 20 5d 20 3b 20 74 68 65 6e 20 65 78 65 63 1" ] ; then exec
03e0: 20 24 30 20 2a 20 3b 20 66 69 0a 0a 23 20 48 6f $0 * ; fi..# Ho
03f0: 73 74 20 6e 61 6d 65 20 70 61 73 73 65 64 20 69 st name passed i
0400: 6e 20 62 79 20 61 62 6f 76 65 20 6f 72 20 69 6e n by above or in
0410: 74 65 72 61 63 74 69 76 65 6c 79 20 66 72 6f 6d teractively from
0420: 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e the command lin
0430: 65 2e 0a 66 6f 72 20 68 6f 73 74 20 69 6e 20 22 e..for host in "
0440: 24 40 22 0a 64 6f 0a 20 20 20 20 62 66 3d 24 68 $@".do. bf=$h
0450: 6f 73 74 2f 63 6f 6e 66 69 67 2e 62 69 6e 0a 20 ost/config.bin.
0460: 20 20 20 65 66 3d 24 68 6f 73 74 2f 65 78 70 6f ef=$host/expo
0470: 72 74 2e 72 73 63 0a 20 20 20 20 69 66 20 21 20 rt.rsc. if !
0480: 5b 20 2d 64 20 24 68 6f 73 74 20 5d 0a 20 20 20 [ -d $host ].
0490: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 23 20 then. #
04a0: 57 65 20 77 65 72 65 20 70 61 73 73 65 64 20 61 We were passed a
04b0: 20 68 6f 73 74 6e 61 6d 65 20 77 69 74 68 6f 75 hostname withou
04c0: 74 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 6c 6f t one or more lo
04d0: 63 61 6c 20 65 78 69 73 74 69 6e 67 0a 20 20 20 cal existing.
04e0: 20 20 20 20 20 23 20 62 61 63 6b 75 70 73 2c 20 # backups,
04f0: 73 6f 20 73 65 74 20 74 68 61 74 20 75 70 2e 20 so set that up.
0500: 20 54 68 69 73 20 73 69 6d 70 6c 69 66 69 65 73 This simplifies
0510: 20 74 68 65 20 66 69 72 73 74 2d 72 75 6e 20 63 the first-run c
0520: 61 73 65 0a 20 20 20 20 20 20 20 20 23 20 62 79 ase. # by
0530: 20 6c 65 74 74 69 6e 67 20 79 6f 75 20 70 61 73 letting you pas
0540: 73 20 74 68 65 20 6e 61 6d 65 73 20 6f 66 20 65 s the names of e
0550: 78 69 73 74 69 6e 67 20 62 75 74 20 61 73 2d 79 xisting but as-y
0560: 65 74 20 75 6e 6d 61 6e 61 67 65 64 0a 20 20 20 et unmanaged.
0570: 20 20 20 20 20 23 20 68 6f 73 74 73 2e 0a 20 20 # hosts..
0580: 20 20 20 20 20 20 6d 6b 64 69 72 20 24 68 6f 73 mkdir $hos
0590: 74 0a 20 20 20 20 20 20 20 20 74 6f 75 63 68 20 t. touch
05a0: 24 62 66 20 24 65 66 0a 20 20 20 20 20 20 20 20 $bf $ef.
05b0: 66 6f 73 73 69 6c 20 61 64 64 20 24 62 66 20 24 fossil add $bf $
05c0: 65 66 0a 20 20 20 20 20 20 20 20 69 6e 69 74 69 ef. initi
05d0: 61 6c 3d 31 0a 20 20 20 20 66 69 0a 0a 20 20 20 al=1. fi..
05e0: 20 69 66 20 5b 20 2d 77 20 24 62 66 20 5d 20 26 if [ -w $bf ] &
05f0: 26 20 5b 20 2d 77 20 24 65 66 20 5d 0a 20 20 20 & [ -w $ef ].
0600: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 23 20 then. #
0610: 50 72 69 6f 72 20 62 61 63 6b 75 70 73 20 65 78 Prior backups ex
0620: 69 73 74 20 e2 80 94 20 69 2e 65 2e 20 6e 6f 74 ist — i.e. not
0630: 20 61 20 73 69 64 65 63 61 72 20 64 69 72 20 68 a sidecar dir h
0640: 6f 6c 64 69 6e 67 20 77 68 6f 20 6b 6e 6f 77 73 olding who knows
0650: 0a 20 20 20 20 20 20 20 20 23 20 77 68 61 74 20 . # what
0660: e2 80 94 20 73 6f 20 70 75 6c 6c 20 66 72 65 73 — so pull fres
0670: 68 20 6f 6e 65 73 2e 20 20 54 6f 73 73 20 63 68 h ones. Toss ch
0680: 61 6e 67 65 73 20 64 65 65 6d 65 64 20 74 72 69 anges deemed tri
0690: 76 69 61 6c 2e 0a 20 20 20 20 20 20 20 20 73 73 vial.. ss
06a0: 68 20 24 68 6f 73 74 20 65 78 70 6f 72 74 20 73 h $host export s
06b0: 68 6f 77 2d 73 65 6e 73 69 74 69 76 65 20 74 65 how-sensitive te
06c0: 72 73 65 20 3e 20 24 68 6f 73 74 2f 65 78 70 6f rse > $host/expo
06d0: 72 74 2e 72 73 63 20 26 26 0a 20 20 20 20 20 20 rt.rsc &&.
06e0: 20 20 20 20 20 20 73 73 68 20 24 68 6f 73 74 20 ssh $host
06f0: 27 2f 73 79 73 74 65 6d 20 62 61 63 6b 75 70 20 '/system backup
0700: 73 61 76 65 27 20 26 26 0a 20 20 20 20 20 20 20 save' &&.
0710: 20 20 20 20 20 66 6e 3d 24 28 73 73 68 20 24 68 fn=$(ssh $h
0720: 6f 73 74 20 27 2f 66 69 6c 65 20 70 72 69 6e 74 ost '/file print
0730: 20 64 65 74 61 69 6c 20 77 69 74 68 6f 75 74 2d detail without-
0740: 70 61 67 69 6e 67 27 20 7c 0a 20 20 20 20 20 20 paging' |.
0750: 20 20 20 20 20 20 20 20 20 20 20 67 72 65 70 20 grep
0760: 27 6e 61 6d 65 3d 22 2e 2a 22 20 74 79 70 65 3d 'name=".*" type=
0770: 22 62 61 63 6b 75 70 22 27 20 7c 0a 20 20 20 20 "backup"' |.
0780: 20 20 20 20 20 20 20 20 20 20 20 20 20 74 61 69 tai
0790: 6c 20 2d 31 20 7c 20 0a 20 20 20 20 20 20 20 20 l -1 | .
07a0: 20 20 20 20 20 20 20 20 20 63 75 74 20 2d 66 32 cut -f2
07b0: 20 2d 64 5c 22 29 20 26 26 0a 20 20 20 20 20 20 -d\") &&.
07c0: 20 20 20 20 20 20 74 65 73 74 20 2d 6e 20 22 24 test -n "$
07d0: 66 6e 22 20 26 26 20 73 63 70 20 24 68 6f 73 74 fn" && scp $host
07e0: 3a 24 66 6e 20 24 68 6f 73 74 2f 63 6f 6e 66 69 :$fn $host/confi
07f0: 67 2e 62 69 6e 0a 20 20 20 20 20 20 20 20 69 66 g.bin. if
0800: 20 5b 20 2d 7a 20 22 24 69 6e 69 74 69 61 6c 22 [ -z "$initial"
0810: 20 5d 20 26 26 0a 20 20 20 20 20 20 20 20 20 20 ] &&.
0820: 20 20 20 20 20 20 21 20 66 6f 73 73 69 6c 20 64 ! fossil d
0830: 69 66 66 20 2d 2d 63 6f 6d 6d 61 6e 64 20 64 69 iff --command di
0840: 66 66 20 24 68 6f 73 74 2f 65 78 70 6f 72 74 2e ff $host/export.
0850: 72 73 63 20 7c 0a 20 20 20 20 20 20 20 20 20 20 rsc |.
0860: 20 20 20 20 20 20 20 20 20 20 67 72 65 70 20 27 grep '
0870: 5e 5b 3c 3e 5d 27 20 7c 0a 20 20 20 20 20 20 20 ^[<>]' |.
0880: 20 20 20 20 20 20 20 20 20 20 20 20 20 67 72 65 gre
0890: 70 20 2d 71 76 20 27 20 62 79 20 52 6f 75 74 65 p -qv ' by Route
08a0: 72 4f 53 20 27 0a 20 20 20 20 20 20 20 20 74 68 rOS '. th
08b0: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 en. f
08c0: 6f 73 73 69 6c 20 72 65 76 65 72 74 20 24 68 6f ossil revert $ho
08d0: 73 74 2f 63 6f 6e 66 69 67 2e 62 69 6e 20 24 68 st/config.bin $h
08e0: 6f 73 74 2f 65 78 70 6f 72 74 2e 72 73 63 0a 20 ost/export.rsc.
08f0: 20 20 20 20 20 20 20 20 20 20 20 73 73 68 20 24 ssh $
0900: 68 6f 73 74 20 22 2f 66 69 6c 65 20 72 65 6d 6f host "/file remo
0910: 76 65 20 24 66 6e 22 0a 20 20 20 20 20 20 20 20 ve $fn".
0920: 66 69 0a 20 20 20 20 66 69 0a 64 6f 6e 65 0a 0a fi. fi.done..
0930: 69 66 20 5b 20 2d 6e 20 22 24 69 6e 69 74 69 61 if [ -n "$initia
0940: 6c 22 20 5d 0a 74 68 65 6e 0a 20 20 20 20 23 20 l" ].then. #
0950: 57 65 20 63 72 65 61 74 65 64 20 6f 6e 65 20 6f We created one o
0960: 72 20 6d 6f 72 65 20 68 6f 73 74 6e 61 6d 65 20 r more hostname
0970: 73 75 62 64 69 72 73 20 61 6e 64 20 69 6e 69 74 subdirs and init
0980: 69 61 6c 20 62 61 63 6b 75 70 20 66 69 6c 65 73 ial backup files
0990: 0a 20 20 20 20 23 20 61 62 6f 76 65 2c 20 73 6f . # above, so
09a0: 20 75 6e 63 6f 6e 64 69 74 69 6f 6e 61 6c 6c 79 unconditionally
09b0: 20 63 6f 6d 6d 69 74 20 74 68 6f 73 65 20 69 6e commit those in
09c0: 69 74 69 61 6c 20 76 65 72 73 69 6f 6e 73 20 6e itial versions n
09d0: 6f 77 2e 0a 20 20 20 20 66 6f 73 73 69 6c 20 63 ow.. fossil c
09e0: 69 20 2d 6d 20 22 69 6e 69 74 69 61 6c 20 62 61 i -m "initial ba
09f0: 63 6b 75 70 20 66 6f 72 20 24 40 22 0a 65 6c 73 ckup for $@".els
0a00: 65 0a 20 20 20 20 23 20 4e 6f 72 6d 61 6c 20 63 e. # Normal c
0a10: 61 73 65 3a 20 63 6f 6d 6d 69 74 20 6f 6e 6c 79 ase: commit only
0a20: 20 61 66 74 65 72 20 75 73 65 72 20 68 61 73 20 after user has
0a30: 61 20 63 68 61 6e 63 65 20 74 6f 20 6c 6f 6f 6b a chance to look
0a40: 20 61 74 20 74 68 65 0a 20 20 20 20 23 20 64 69 at the. # di
0a50: 66 66 73 20 6f 66 20 74 68 65 20 74 65 78 74 20 ffs of the text
0a60: 62 61 63 6b 75 70 73 2e 0a 20 20 20 20 66 69 6c backups.. fil
0a70: 74 65 72 3d 63 61 74 0a 20 20 20 20 69 66 20 5b ter=cat. if [
0a80: 20 2d 6e 20 22 24 53 53 48 5f 43 4f 4e 4e 45 43 -n "$SSH_CONNEC
0a90: 54 49 4f 4e 22 20 5d 0a 20 20 20 20 74 68 65 6e TION" ]. then
0aa0: 0a 20 20 20 20 20 20 20 20 23 20 57 65 27 72 65 . # We're
0ab0: 20 62 65 69 6e 67 20 72 75 6e 20 6f 76 65 72 20 being run over
0ac0: 61 6e 20 53 53 48 20 63 6f 6e 6e 2e 20 20 53 69 an SSH conn. Si
0ad0: 6e 63 65 20 63 68 61 6e 63 65 73 20 61 72 65 20 nce chances are
0ae0: 6e 6f 74 20 67 6f 6f 64 0a 20 20 20 20 20 20 20 not good.
0af0: 20 23 20 74 68 61 74 20 58 31 31 20 66 6f 72 77 # that X11 forw
0b00: 61 72 64 69 6e 67 20 69 73 20 62 65 69 6e 67 20 arding is being
0b10: 64 6f 6e 65 2c 20 6f 72 20 69 66 20 69 74 20 69 done, or if it i
0b20: 73 20 74 68 61 74 20 74 68 65 20 67 64 69 66 66 s that the gdiff
0b30: 0a 20 20 20 20 20 20 20 20 23 20 69 6d 70 6c 65 . # imple
0b40: 6d 65 6e 74 61 74 69 6f 6e 20 69 73 6e 27 74 20 mentation isn't
0b50: 58 2d 62 61 73 65 64 2c 20 75 73 65 20 63 6f 6e X-based, use con
0b60: 73 6f 6c 65 20 64 69 66 66 2e 20 20 52 75 6e 20 sole diff. Run
0b70: 69 74 20 74 68 72 75 0a 20 20 20 20 20 20 20 20 it thru.
0b80: 23 20 61 20 70 61 67 65 72 20 74 6f 20 6d 61 6b # a pager to mak
0b90: 65 20 69 74 20 62 6c 6f 63 6b 2e 0a 20 20 20 20 e it block..
0ba0: 20 20 20 20 64 69 66 66 63 6d 64 3d 64 69 66 66 diffcmd=diff
0bb0: 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 2d 6e . if [ -n
0bc0: 20 22 24 50 41 47 45 52 22 20 5d 20 3b 20 74 68 "$PAGER" ] ; th
0bd0: 65 6e 20 66 69 6c 74 65 72 3d 24 50 41 47 45 52 en filter=$PAGER
0be0: 20 3b 20 65 6c 73 65 20 66 69 6c 74 65 72 3d 6c ; else filter=l
0bf0: 65 73 73 20 3b 20 66 69 0a 20 20 20 20 65 6c 69 ess ; fi. eli
0c00: 66 20 5b 20 22 24 28 66 6f 73 73 69 6c 20 73 65 f [ "$(fossil se
0c10: 74 20 67 64 69 66 66 2d 63 6f 6d 6d 61 6e 64 29 t gdiff-command)
0c20: 22 20 21 3d 20 22 67 64 69 66 66 2d 63 6f 6d 6d " != "gdiff-comm
0c30: 61 6e 64 22 20 5d 0a 20 20 20 20 74 68 65 6e 0a and" ]. then.
0c40: 20 20 20 20 20 20 20 20 23 20 54 68 65 20 75 73 # The us
0c50: 65 72 27 73 20 73 65 74 20 61 20 67 72 61 70 68 er's set a graph
0c60: 69 63 61 6c 20 64 69 66 66 20 63 6f 6d 6d 61 6e ical diff comman
0c70: 64 2c 20 73 6f 20 75 73 65 20 69 74 2e 0a 20 20 d, so use it..
0c80: 20 20 20 20 20 20 64 69 66 66 63 6d 64 3d 67 64 diffcmd=gd
0c90: 69 66 66 20 0a 20 20 20 20 65 6c 73 65 0a 20 20 iff . else.
0ca0: 20 20 20 20 20 20 23 20 46 61 6c 6c 20 62 61 63 # Fall bac
0cb0: 6b 20 74 6f 20 74 68 65 20 62 72 6f 77 73 65 72 k to the browser
0cc0: 2d 62 61 73 65 64 20 64 69 66 66 20 66 65 61 74 -based diff feat
0cd0: 75 72 65 20 61 64 64 65 64 20 69 6e 20 46 6f 73 ure added in Fos
0ce0: 73 69 6c 0a 20 20 20 20 20 20 20 20 23 20 32 2e sil. # 2.
0cf0: 31 37 2e 20 20 4c 61 73 74 20 62 65 63 61 75 73 17. Last becaus
0d00: 65 20 74 68 69 73 20 77 6f 6e 27 74 20 62 6c 6f e this won't blo
0d10: 63 6b 20 6c 69 6b 65 20 74 68 65 20 6f 74 68 65 ck like the othe
0d20: 72 20 6f 70 74 69 6f 6e 73 2c 0a 20 20 20 20 20 r options,.
0d30: 20 20 20 23 20 73 6f 20 79 6f 75 20 77 6f 6e 27 # so you won'
0d40: 74 20 68 61 76 65 20 61 20 63 68 61 6e 63 65 20 t have a chance
0d50: 74 6f 20 61 62 6f 72 74 20 74 68 65 20 63 6f 6d to abort the com
0d60: 6d 69 74 20 62 79 20 73 65 6e 64 69 6e 67 0a 20 mit by sending.
0d70: 20 20 20 20 20 20 20 23 20 43 74 72 6c 2d 43 20 # Ctrl-C
0d80: 74 6f 20 74 68 69 73 20 73 63 72 69 70 74 2e 0a to this script..
0d90: 20 20 20 20 20 20 20 20 64 69 66 66 63 6d 64 3d diffcmd=
0da0: 22 64 69 66 66 20 2d 62 22 0a 20 20 20 20 66 69 "diff -b". fi
0db0: 0a 0a 20 20 20 20 23 20 43 6f 6d 6d 69 74 20 74 .. # Commit t
0dc0: 68 65 20 63 68 61 6e 67 65 73 20 75 6e 6c 65 73 he changes unles
0dd0: 73 20 74 68 65 20 64 69 66 66 20 66 61 69 6c 73 s the diff fails
0de0: 2e 0a 20 20 20 20 69 66 20 66 6f 73 73 69 6c 20 .. if fossil
0df0: 24 64 69 66 66 63 6d 64 20 2a 2f 2a 2e 72 73 63 $diffcmd */*.rsc
0e00: 20 7c 20 24 66 69 6c 74 65 72 0a 20 20 20 20 74 | $filter. t
0e10: 68 65 6e 0a 20 20 20 20 20 20 20 20 66 6f 73 73 hen. foss
0e20: 69 6c 20 63 69 0a 20 20 20 20 65 6c 73 65 0a 20 il ci. else.
0e30: 20 20 20 20 20 20 20 66 6f 73 73 69 6c 20 72 65 fossil re
0e40: 76 65 72 74 0a 20 20 20 20 66 69 0a 66 69 0a vert. fi.fi.