/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/_walkdirs_win32.pyx

  • Committer: Vincent Ladeuil
  • Date: 2009-06-30 15:54:23 UTC
  • mto: (4496.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4497.
  • Revision ID: v.ladeuil+lp@free.fr-20090630155423-afousrl3zrdx0he2
Fixed as per jam's review.

* tests/blackbox/test_push.py:
(load_tests): One more changes type.
(TestPushStrictMixin): Switch to using mixin, it's clearer.
Define some default values as attributes so that they can be
changed more easily.
(TestPushStrictMixin.assertPushFails,
TestPushStrictMixin.assertPushSucceeds): Use default values from
attributes.
(TestPushStrictWithChanges._out_of_sync_trees): Setup a new
context and change the default values.

* errors.py:
(OutOfDateTree, UncommittedChanges): Add a more parameter so more
details can be given.

* builtins.py:
(cmd_push.run): Add an additional check that the tree is still in
sync with its branch before pushing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
109
109
                                 wcslen(data.cFileName))
110
110
 
111
111
 
112
 
cdef int _get_mode_bits(WIN32_FIND_DATAW *data): # cannot_raise
 
112
cdef int _get_mode_bits(WIN32_FIND_DATAW *data):
113
113
    cdef int mode_bits
114
114
 
115
115
    mode_bits = 0100666 # writeable file, the most common
121
121
    return mode_bits
122
122
 
123
123
 
124
 
cdef __int64 _get_size(WIN32_FIND_DATAW *data): # cannot_raise
 
124
cdef __int64 _get_size(WIN32_FIND_DATAW *data):
125
125
    # Pyrex casts a DWORD into a PyLong anyway, so it is safe to do << 32
126
126
    # on a DWORD
127
127
    return ((<__int64>data.nFileSizeHigh) << 32) + data.nFileSizeLow
128
128
 
129
129
 
130
 
cdef double _ftime_to_timestamp(FILETIME *ft): # cannot_raise
 
130
cdef double _ftime_to_timestamp(FILETIME *ft):
131
131
    """Convert from a FILETIME struct into a floating point timestamp.
132
132
 
133
133
    The fields of a FILETIME structure are the hi and lo part
147
147
    return (val * 1.0e-7) - 11644473600.0
148
148
 
149
149
 
150
 
cdef int _should_skip(WIN32_FIND_DATAW *data): # cannot_raise
 
150
cdef int _should_skip(WIN32_FIND_DATAW *data):
151
151
    """Is this '.' or '..' so we should skip it?"""
152
152
    if (data.cFileName[0] != c'.'):
153
153
        return 0