src, #519: collect all is_<platform>() calls · gitpython-developers/GitPython@f495e94

@@ -6,7 +6,6 @@

6677

# Module implementing a remote object allowing easy access to git remotes

88

import re

9-

import os

1091110

from .config import (

1211

SectionConstraint,

@@ -32,7 +31,7 @@

3231

)

3332

from git.cmd import handle_process_output

3433

from gitdb.util import join

35-

from git.compat import (defenc, force_text)

34+

from git.compat import (defenc, force_text, is_win)

3635

import logging

37363837

log = logging.getLogger('git.remote')

@@ -113,7 +112,7 @@ def __init__(self, flags, local_ref, remote_ref_string, remote, old_commit=None,

113112

self._remote = remote

114113

self._old_commit_sha = old_commit

115114

self.summary = summary

116-115+117116

@property

118117

def old_commit(self):

119118

return self._old_commit_sha and self._remote.repo.commit(self._old_commit_sha) or None

@@ -377,7 +376,7 @@ def __init__(self, repo, name):

377376

self.repo = repo

378377

self.name = name

379378380-

if os.name == 'nt':

379+

if is_win():

381380

# some oddity: on windows, python 2.5, it for some reason does not realize

382381

# that it has the config_writer property, but instead calls __getattr__

383382

# which will not yield the expected results. 'pinging' the members

@@ -635,7 +634,7 @@ def _get_fetch_info_from_stderr(self, proc, progress):

635634

# end

636635

if progress.error_lines():

637636

stderr_text = '\n'.join(progress.error_lines())

638-637+639638

finalize_process(proc, stderr=stderr_text)

640639641640

# read head information

@@ -657,7 +656,7 @@ def _get_fetch_info_from_stderr(self, proc, progress):

657656

fetch_info_lines = fetch_info_lines[:l_fhi]

658657

# end truncate correct list

659658

# end sanity check + sanitization

660-659+661660

output.extend(FetchInfo._from_line(self.repo, err_line, fetch_line)

662661

for err_line, fetch_line in zip(fetch_info_lines, fetch_head_info))

663662

return output

@@ -769,17 +768,17 @@ def push(self, refspec=None, progress=None, **kwargs):

769768

:param refspec: see 'fetch' method

770769

:param progress:

771770

Can take one of many value types:

772-771+773772

* None to discard progress information

774773

* A function (callable) that is called with the progress infomation.

775-774+776775

Signature: ``progress(op_code, cur_count, max_count=None, message='')``.

777-776+778777

`Click here <http://goo.gl/NPa7st>`_ for a description of all arguments

779778

given to the function.

780779

* An instance of a class derived from ``git.RemoteProgress`` that

781780

overrides the ``update()`` function.

782-781+783782

:note: No further progress information is returned after push returns.

784783

:param kwargs: Additional arguments to be passed to git-push

785784

:return: