monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] automate get_current_revision failing


From: Thomas Moschny
Subject: [Monotone-devel] automate get_current_revision failing
Date: Sat, 07 Mar 2009 00:28:55 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

In f62181ae.. someone made "mtn automate get_current_revision" fail in
case the workspace is clean, and the revision is trivial (empty
changeset). I don't see why this should fail, and furthermore, it breaks
 the logic that makes "mtn revision --full" display changes made against
the base revision.

So, I'd like to partially revert that (see patched attached).

Any objections?

- - Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkmxsbcACgkQm/6MhNYca5jodgCggs5JkIahd2/C66oLXC/d5QgA
sDoAn32ZHxIB2swDfYHeUFEx7iGshamO
=zV9Z
-----END PGP SIGNATURE-----
#
# old_revision [d24b59732a5b3293592457cba013c8f8b716a875]
#
# patch "automate.cc"
#  from [63b44f3c2366f52a040cc8d0029ffc1d896740d9]
#    to [4a5ef4b00f72c0c766b65bcf4d26fce3c662cbfc]
# 
# patch "monotone.texi"
#  from [50c10e49ae961d0b36374f02b09b5af2fab9cb00]
#    to [d562dab57e07e0822e54af0b40dea69881c085c5]
# 
# patch "tests/automate_get_current_revision/__driver__.lua"
#  from [a56d2598ca7be71521f38b0a577baa92fbf55022]
#    to [febb7bc6adea00e46e2f0e932ec3f939badab4a2]
#
============================================================
--- automate.cc 63b44f3c2366f52a040cc8d0029ffc1d896740d9
+++ automate.cc 4a5ef4b00f72c0c766b65bcf4d26fce3c662cbfc
@@ -1260,8 +1260,7 @@ CMD_AUTOMATE(get_revision, N_("REVID"),
 // Added in: 7.0
 // Purpose: Outputs (an optionally restricted) revision based on
 //          changes in the current workspace
-// Error conditions: If there are no changes in the current workspace or the
-// restriction is invalid or has no recorded changes, prints an error message
+// Error conditions: If the restriction is invalid, prints an error message
 // to stderr and exits with status 1. A workspace is required.
 CMD_AUTOMATE(get_current_revision, N_("[PATHS ...]"),
              N_("Shows change information for a workspace"),
@@ -1293,7 +1292,6 @@ CMD_AUTOMATE(get_current_revision, N_("[
   make_restricted_revision(old_rosters, new_roster, mask, rev,
                            excluded, join_words(execid));
   rev.check_sane();
-  E(rev.is_nontrivial(), origin::user, F("no changes to commit"));
 
   calculate_ident(rev, ident);
   write_revision(rev, dat);
============================================================
--- monotone.texi       50c10e49ae961d0b36374f02b09b5af2fab9cb00
+++ monotone.texi       d562dab57e07e0822e54af0b40dea69881c085c5
@@ -7716,9 +7716,8 @@ @section Automation
 
 @item Error conditions:
 
-If the command is executed outside of a workspace, there are no changes in the
-current workspace or the restriction is invalid or has no recorded changes,
-prints an error message to stderr and exits with status 1.
+If the command is executed outside of a workspace, or the restriction is
+invalid, prints an error message to stderr and exits with status 1.
 
 @end table
 
============================================================
--- tests/automate_get_current_revision/__driver__.lua  
a56d2598ca7be71521f38b0a577baa92fbf55022
+++ tests/automate_get_current_revision/__driver__.lua  
febb7bc6adea00e46e2f0e932ec3f939badab4a2
@@ -6,8 +6,7 @@ check(mtn("commit", "--date=2005-05-21T1
           "--branch=testbranch", "--message=blah-blah"), 0, false, false) 
           
 -- ensure clear workspace fails wih error
-check(mtn("automate", "get_current_revision"), 1, true, false)
-check(fsize("stdout") == 0)
+check(mtn("automate", "get_current_revision"), 0, true, false)
 
 addfile("foox", "blah\n")
 addfile("barx", "blah2\n")

Attachment: get_current_revision.patch.sig
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]