[Pkg-bazaar-commits] ./bzr/unstable r233: - more output from test.sh

mbp at sourcefrog.net mbp at sourcefrog.net
Fri Apr 10 07:51:30 UTC 2009


------------------------------------------------------------
revno: 233
committer: mbp at sourcefrog.net
timestamp: Mon 2005-04-11 11:58:58 +1000
message:
  - more output from test.sh
  - write revison-history in a way that is hardlink-safe
modified:
  bzrlib/branch.py
  bzrlib/commands.py
  test.sh
-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2005-04-07 05:57:33 +0000
+++ b/bzrlib/branch.py	2005-04-11 01:58:58 +0000
@@ -555,15 +555,32 @@
         ## TODO: Also calculate and store the inventory SHA1
         mutter("committing patch r%d" % (self.revno() + 1))
 
-        mutter("append to revision-history")
-        f = self.controlfile('revision-history', 'at')
-        f.write(rev_id + '\n')
-        f.close()
 
+        self.append_revision(rev_id)
+        
         if verbose:
             note("commited r%d" % self.revno())
 
 
+    def append_revision(self, revision_id):
+        mutter("add {%s} to revision-history" % revision_id)
+        rev_history = self.revision_history()
+
+        tmprhname = self.controlfilename('revision-history.tmp')
+        rhname = self.controlfilename('revision-history')
+        
+        f = file(tmprhname, 'wt')
+        rev_history.append(revision_id)
+        f.write('\n'.join(rev_history))
+        f.write('\n')
+        f.close()
+
+        if sys.platform == 'win32':
+            os.remove(rhname)
+        os.rename(tmprhname, rhname)
+        
+
+
     def get_revision(self, revision_id):
         """Return the Revision object for a named revision"""
         r = Revision.read_xml(self.revision_store[revision_id])

=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-04-11 01:01:35 +0000
+++ b/bzrlib/commands.py	2005-04-11 01:58:58 +0000
@@ -126,6 +126,8 @@
 
     :todo: Don't show unchanged files unless ``--all`` is given?
     """
+    #import bzrlib.status
+    #bzrlib.status.tree_status(Branch('.'))
     Branch('.').show_status(show_all=all)
 
 

=== modified file 'test.sh'
--- a/test.sh	2005-04-06 02:20:40 +0000
+++ b/test.sh	2005-04-11 01:58:58 +0000
@@ -9,10 +9,14 @@
 # This must already exist and be in the right place
 if ! [ -d bzr-test.tmp ] 
 then
-    echo "please create bzr-test.tmp"
+    echo "please create directory bzr-test.tmp"
     exit 1
 fi
 
+echo "testing `which bzr`"
+bzr --version | head -n 1
+echo
+
 rm -rf bzr-test.tmp
 mkdir bzr-test.tmp
 
@@ -32,6 +36,9 @@
 cd bzr-test.tmp 
 rm -rf .bzr
 
+mkdir branch1
+cd branch1
+
 # some information commands
 bzr help
 bzr version
@@ -99,3 +106,6 @@
 
 
 
+# now test hardlinked branches in subdirectories
+
+echo "tests completed ok" >&3
\ No newline at end of file



More information about the Pkg-bazaar-commits mailing list