Rev 3346: (bialix) osutils.backup_file() is removed. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Apr 8 20:23:22 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3346
revision-id:pqm at pqm.ubuntu.com-20080408192311-eoozb2m0s383xt35
parent: pqm at pqm.ubuntu.com-20080408124131-ar7bjhzp6bzggv8m
parent: bialix at ukr.net-20080407073432-rcus3s4o6yjp727k
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2008-04-08 20:23:11 +0100
message:
  (bialix) osutils.backup_file() is removed.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
    ------------------------------------------------------------
    revno: 3341.1.1
    revision-id:bialix at ukr.net-20080407073432-rcus3s4o6yjp727k
    parent: pqm at pqm.ubuntu.com-20080407044456-s1a9orh0kssphdh9
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: delete-backup-file
    timestamp: Mon 2008-04-07 10:34:32 +0300
    message:
      osutils.backup_file() is removed.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
=== modified file 'NEWS'
--- a/NEWS	2008-04-08 07:46:55 +0000
+++ b/NEWS	2008-04-08 19:23:11 +0000
@@ -130,6 +130,8 @@
       show_merge_revno methods. The latter had been deprecated since the 0.17
       release. (James Westby)
 
+    * ``osutils.backup_file`` is removed. (Alexander Belchenko)
+
     * ``Repository.get_revision_graph`` is deprecated, with no replacement
       method. The method was size(history) and not desirable. (Robert Collins)
 

=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py	2008-02-28 01:33:35 +0000
+++ b/bzrlib/osutils.py	2008-04-07 07:34:32 +0000
@@ -468,35 +468,6 @@
         return pathjoin(F(p), e)
 
 
- at deprecated_function(one_zero)
-def backup_file(fn):
-    """Copy a file to a backup.
-
-    Backups are named in GNU-style, with a ~ suffix.
-
-    If the file is already a backup, it's not copied.
-    """
-    if fn[-1] == '~':
-        return
-    bfn = fn + '~'
-
-    if has_symlinks() and os.path.islink(fn):
-        target = os.readlink(fn)
-        os.symlink(target, bfn)
-        return
-    inf = file(fn, 'rb')
-    try:
-        content = inf.read()
-    finally:
-        inf.close()
-    
-    outf = file(bfn, 'wb')
-    try:
-        outf.write(content)
-    finally:
-        outf.close()
-
-
 def isdir(f):
     """True if f is an accessible directory."""
     try:




More information about the bazaar-commits mailing list