~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: Vincent Ladeuil
  • Date: 2011-06-15 11:36:05 UTC
  • mto: This revision was merged to the branch mainline in revision 5975.
  • Revision ID: v.ladeuil+lp@free.fr-20110615113605-p7zyyfry9wy1hquc
Make ContentConflict resolution more robust

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import sys
26
26
 
27
27
from bzrlib import cmdline
28
 
from bzrlib.i18n import gettext
29
28
 
30
29
# Windows version
31
30
if sys.platform == 'win32':
129
128
            ctypes.byref(mem_struct),
130
129
            ctypes.sizeof(mem_struct))
131
130
        if not ret:
132
 
            trace.note(gettext('Failed to GetProcessMemoryInfo()'))
 
131
            trace.note('Failed to GetProcessMemoryInfo()')
133
132
            return
134
133
        info = {'PageFaultCount': mem_struct.PageFaultCount,
135
134
                'PeakWorkingSetSize': mem_struct.PeakWorkingSetSize,
150
149
        proc = win32process.GetCurrentProcess()
151
150
        info = win32process.GetProcessMemoryInfo(proc)
152
151
    else:
153
 
        trace.note(gettext('Cannot debug memory on win32 without ctypes'
154
 
                   ' or win32process'))
 
152
        trace.note('Cannot debug memory on win32 without ctypes'
 
153
                   ' or win32process')
155
154
        return
156
155
    if short:
157
156
        # using base-2 units (see HACKING.txt).
158
 
        trace.note(gettext('WorkingSize {0:>7}KiB'
159
 
                   '\tPeakWorking {1:>7}KiB\t{2}').format(
 
157
        trace.note('WorkingSize %7dKiB'
 
158
                   '\tPeakWorking %7dKiB\t%s',
160
159
                   info['WorkingSetSize'] / 1024,
161
160
                   info['PeakWorkingSetSize'] / 1024,
162
 
                   message))
 
161
                   message)
163
162
        return
164
163
    if message:
165
164
        trace.note('%s', message)
166
 
    trace.note(gettext('WorkingSize       %8d KiB'), info['WorkingSetSize'] / 1024)
167
 
    trace.note(gettext('PeakWorking       %8d KiB'), info['PeakWorkingSetSize'] / 1024)
168
 
    trace.note(gettext('PagefileUsage     %8d KiB'), info.get('PagefileUsage', 0) / 1024)
169
 
    trace.note(gettext('PeakPagefileUsage %8d KiB'),
 
165
    trace.note('WorkingSize       %8d KiB', info['WorkingSetSize'] / 1024)
 
166
    trace.note('PeakWorking       %8d KiB', info['PeakWorkingSetSize'] / 1024)
 
167
    trace.note('PagefileUsage     %8d KiB', info.get('PagefileUsage', 0) / 1024)
 
168
    trace.note('PeakPagefileUsage %8d KiB',
170
169
               info.get('PeakPagefileUsage', 0) / 1024)
171
 
    trace.note(gettext('PrivateUsage      %8d KiB'), info.get('PrivateUsage', 0) / 1024)
172
 
    trace.note(gettext('PageFaultCount    %8d'), info.get('PageFaultCount', 0))
 
170
    trace.note('PrivateUsage      %8d KiB', info.get('PrivateUsage', 0) / 1024)
 
171
    trace.note('PageFaultCount    %8d', info.get('PageFaultCount', 0))
173
172
 
174
173
 
175
174
def get_console_size(defaultx=80, defaulty=25):