https://svn.lrde.epita.fr/svn/lrdetools/trunk
Index: ChangeLog
from Nicolas Pouillard <ertai(a)lrde.epita.fr>
Generalize the color usage.
* vcs/lib/vcs/vcs.rb: Add Vcs#color? and Vcs#color, remove Vcs.color.
* vcs/lib/vcs/status.rb: Simplify using the generalized version.
status.rb | 10 ++++------
vcs.rb | 21 +++++++++++++++++----
2 files changed, 21 insertions(+), 10 deletions(-)
Index: vcs/lib/vcs/vcs.rb
--- vcs/lib/vcs/vcs.rb (revision 240)
+++ vcs/lib/vcs/vcs.rb (working copy)
@@ -293,6 +293,23 @@
end
end
+ def color?
+ case Vcs.user_conf.color
+ when :never then return false
+ when :auto then return output.tty?
+ when :always then return true
+ else raise ArgumentError, "Bad value for Vcs.color: #{Vcs.color}"
+ end
+ end
+
+ def color ( aString, *someStyles )
+ if color?
+ @h.color(aString, *someStyles)
+ else
+ aString
+ end
+ end
+
CL = Pathname.new('ChangeLog') unless defined? CL
TMP_CL = Pathname.new(',,ChangeLog') unless defined? TMP_CL
@@ -383,10 +400,6 @@
end
end
- def color
- user_conf.color
- end
-
# Here we can handle version conflicts with vcs extensions
def protocol_version ( aVersion )
if aVersion != '0.1'
Index: vcs/lib/vcs/status.rb
--- vcs/lib/vcs/status.rb (revision 240)
+++ vcs/lib/vcs/status.rb (working copy)
@@ -40,16 +40,14 @@
end
def status! ( *args )
- case Vcs.color
- when :never
- when :auto then return color_status!(*args) if output.tty?
- when :always then return color_status!(*args)
- else raise ArgumentError, "Bad value for Vcs.color: #{Vcs.color}"
- end
+ if color?
+ color_status!(*args)
+ else
from_status(*args) do |line, file_st, prop_st, cpy, file|
puts line
end
end
+ end
@@style ||=
{
https://svn.lrde.epita.fr/svn/lrdetools/trunk
Index: ChangeLog
from Nicolas Pouillard <ertai(a)lrde.epita.fr>
Rename ,messages to +commited.
* vcs/lib/vcs/common_commit.rb: Update.
* vcs/NEWS: Add an entry for this change.
* vcs/lib/vcs/vcs.rb: Match the complete path *or* the basename.
NEWS | 3 +++
lib/vcs/common_commit.rb | 2 +-
lib/vcs/vcs.rb | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
Index: vcs/lib/vcs/common_commit.rb
--- vcs/lib/vcs/common_commit.rb (revision 237)
+++ vcs/lib/vcs/common_commit.rb (working copy)
@@ -53,7 +53,7 @@
LOG.info 'Deleting junk files...'
TMP_CL.delete if TMP_CL.exist?
- destdir = ',messages'.to_path/iform['revision'].to_s
+ destdir = '+commited'.to_path/iform['revision'].to_s
destdir.mkpath unless destdir.directory?
[LogEntry, Form, IForm, Message, MAIL, NEWS].each do |path|
next unless path.exist?
Index: vcs/NEWS
--- vcs/NEWS (revision 237)
+++ vcs/NEWS (working copy)
@@ -36,6 +36,9 @@
the status. The color activation can be choose in your configuration
file (auto, never, always).
+ * ,messages is now +commited: You can rename your ,messages and keep just
+ one directory for commited meta information.
+
New in 0.3 2005-09-16:
* The help command now show all commands including vcs ones.
Index: vcs/lib/vcs/vcs.rb
--- vcs/lib/vcs/vcs.rb (revision 237)
+++ vcs/lib/vcs/vcs.rb (working copy)
@@ -362,7 +362,7 @@
return false
end
regexps.each do |re|
- return true if re.match(file)
+ return true if re.match(file) or re.match(file.basename)
end
return false
end
>>> "Nicolas" == Nicolas Pouillard <ertai(a)lrde.epita.fr> writes:
> Index: vcs/NEWS
> --- vcs/NEWS (revision 231)
> +++ vcs/NEWS (working copy)
> @@ -1,5 +1,15 @@
> New in 0.4 ...:
> + * Vcs extensions files:
> + - Protocol version:
> + You can now add `protocol_version "0.1"' in your extensions. Thus
> + you will be alert when the format will changes.
s/alert/warned/ s/will//
> + - Default commit:
> + By adding `default_commit :your_commit_method' you override the
> + default commit method with yours. So you can call `commit' and `ci',
> + but also your old aliases. Of course you can call the real commit
> + with `commit_' or `ci_'.
I'm not sure that's the real feature one wants. What is desirable is
to built on top of the current method. This is very similar to using
the "super" method (or "Precursor" in Eiffel parlance).
This should be possible for all the commands.