/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/export/dir_exporter.py

  • Committer: Parth Malwankar
  • Date: 2010-03-17 05:36:11 UTC
  • mfrom: (5091 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5092.
  • Revision ID: parth.malwankar@gmail.com-20100317053611-xpmn8gili6j191in
merged in trunk. fixed blackbox.test_upgrade to use backup.bzr.~N~ convention.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import errno
20
20
import os
21
 
import StringIO
22
21
import time
23
22
 
24
23
from bzrlib import errors, osutils
30
29
from bzrlib.trace import mutter
31
30
 
32
31
 
33
 
def dir_exporter(tree, dest, root, subdir, filtered=False):
 
32
def dir_exporter(tree, dest, root, subdir, filtered=False,
 
33
                 per_file_timestamps=False):
34
34
    """Export this tree to a new directory.
35
35
 
36
36
    `dest` should either not exist or should be empty. If it does not exist it
92
92
            out.writelines(chunks)
93
93
        finally:
94
94
            out.close()
95
 
        os.utime(fullpath, (now, now))
 
95
        if per_file_timestamps:
 
96
            mtime = tree.get_file_mtime(tree.path2id(relpath), relpath)
 
97
        else:
 
98
            mtime = now
 
99
        os.utime(fullpath, (mtime, mtime))