[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r116819: * admin/update_autogen: Auto-detect VCS in
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] trunk r116819: * admin/update_autogen: Auto-detect VCS in use. |
Date: |
Fri, 21 Mar 2014 06:39:18 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 116819
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2014-03-20 23:39:13 -0700
message:
* admin/update_autogen: Auto-detect VCS in use.
(vcs): New variable.
(status, commit, main): Handle git.
modified:
admin/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-2226
admin/update_autogen
update_autogen-20110320234513-evoa2jhg3q7dkdg8-8
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog 2014-03-07 18:57:11 +0000
+++ b/admin/ChangeLog 2014-03-21 06:39:13 +0000
@@ -1,3 +1,9 @@
+2014-03-21 Glenn Morris <address@hidden>
+
+ * update_autogen: Auto-detect VCS in use.
+ (vcs): New variable.
+ (status, commit, main): Handle git.
+
2014-03-07 Paul Eggert <address@hidden>
Fix oversight preventing lib/sys/types.h from being generated.
=== modified file 'admin/update_autogen'
--- a/admin/update_autogen 2014-01-13 21:17:18 +0000
+++ b/admin/update_autogen 2014-03-21 06:39:13 +0000
@@ -47,6 +47,14 @@
cd ../
[ -d admin ] || die "Could not locate admin directory"
+if [ -d .bzr ]; then
+ vcs=bzr
+elif [ -d .git ]; then
+ vcs=git
+else
+ die "Cannot determine vcs"
+fi
+
usage ()
{
@@ -143,7 +151,10 @@
## Run status on inputs, list modified files on stdout.
status ()
{
- bzr status -S "$@" >| $tempfile || die "bzr status error for $@"
+ local statflag="-S"
+ [ "$vcs" = "git" ] && statflag="-s"
+
+ $vcs status $statflag "$@" >| $tempfile || die "$vcs status error for $@"
local stat file modified
@@ -217,8 +228,11 @@
echo "Committing..."
- ## bzr status output is always relative to top-level, not PWD.
- bzr commit -m "Auto-commit of $type files." "$@" || return $?
+ $vcs commit -m "Auto-commit of $type files." "$@" || return $?
+
+ [ "$vcs" = "git" ] && {
+ $vcs push || return $?
+ }
echo "Committed files: $@"
} # function commit
@@ -257,7 +271,7 @@
*-xtra.texi|*efaq-w32.texi) continue ;;
esac
- dircat=`sed -n -e 's/@value{emacsname}/Emacs/' -e
's/address@hidden //p' $file`
+ dircat=$(sed -n -e 's/@value{emacsname}/Emacs/' -e
's/address@hidden //p' $file)
## TODO warn about unknown topics (check-info in top-level
## Makefile does this).
@@ -291,7 +305,8 @@
modified=$(status $basegen) || die
- cd $oldpwd
+ ## bzr status output is always relative to top-level, not PWD.
+ [ "$vcs" = "bzr" ] && cd $oldpwd
commit "generated" $modified || die "commit error"
@@ -364,7 +379,8 @@
modified=$(status $genfiles ${ldefs_out#lisp/}) || die
-cd ../
+## bzr status output is always relative to top-level, not PWD.
+[ "$vcs" = "bzr" ] && cd ../
commit "loaddefs" $modified || die "commit error"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r116819: * admin/update_autogen: Auto-detect VCS in use.,
Glenn Morris <=