summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--defs/gmake.mk14
-rw-r--r--tool/vcs.rb13
2 files changed, 14 insertions, 13 deletions
diff --git a/defs/gmake.mk b/defs/gmake.mk
index 3698f33..d961e27 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -136,22 +136,10 @@ $(TIMESTAMPDIR)/.exec.time:
$(Q) mkdir exec
$(Q) exit > $@
-ifneq (,)
-else ifeq ($(VCS),svn)
-VCSCOMMIT = $(VCS) commit $(SVNCOMMITOPTIONS)
-else ifeq ($(VCS),git svn)
-VCSCOMMIT = $(VCS) dcommit $(GITSVNCOMMITOPTIONS)
-VCSWAIT = sleep 2 # wait for svn to git sync
-else ifeq ($(VCS),git)
-VCSCOMMIT := $(VCS) push $(GITCOMMITOPTIONS)
-endif
-ifneq ($(VCSCOMMIT),)
.PHONY: commit
commit: $(if $(filter commit,$(MAKECMDGOALS)),$(filter-out commit,$(MAKECMDGOALS)))
- @$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSCOMMIT)
- $(Q)$(VCSWAIT)
+ @$(BASERUBY) -C "$(srcdir)" -I./tool -rvcs -e 'VCS.detect(".").commit'
$(Q)$(MAKE) $(mflags) Q=$(Q) REVISION_FORCE=PHONY update-src srcs all-incs
-endif
ifeq ($(words $(filter update-gems extract-gems,$(MAKECMDGOALS))),2)
extract-gems: update-gems
diff --git a/tool/vcs.rb b/tool/vcs.rb
index d54094a..ec75840 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -317,6 +317,10 @@ class VCS
end
end
end
+
+ def commit
+ system(*%W"#{COMMAND} commit")
+ end
end
class GIT < self
@@ -456,5 +460,14 @@ class VCS
end
end
end
+
+ def commit
+ rev = cmd_read(%W"#{COMMAND} svn info"+[STDERR=>[:child, :out]])[/^Last Changed Rev: (\d+)/, 1]
+ ret = system(COMMAND, "svn", "dcommit")
+ if ret and rev
+ cmd_read(%W"#{COMMAND} svn reset -r#{rev}")
+ end
+ ret
+ end
end
end