Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77cd665

Browse files
committed
Renamed modules utils to util, and errors to exc to be more conforming to the submodules's naming conventions
1 parent 791765c commit 77cd665

22 files changed

+35
-31
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ CHANGES
1717
They may only be initialized using their binary shas, reference names or revision specs are not allowed anymore.
1818
* The .data attribute was removed from the Object type, it is only available
1919
on the Blob type.
20+
* For consistency with naming conventions used in sub-modules like gitdb, the following modules have been renamed
21+
* git.utils -> git.util
22+
* git.errors -> git.exc
23+
* git.objects.utils -> git.objects.util
2024

2125

2226
0.2 Beta 2

lib/git/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ def _init_externals():
2828
from git.objects import *
2929
from git.refs import *
3030
from git.diff import *
31-
from git.errors import *
31+
from git.exc import *
3232
from git.cmd import Git
3333
from git.repo import Repo
3434
from git.remote import *
3535
from git.index import *
36-
from git.utils import (
36+
from git.util import (
3737
LockFile,
3838
BlockingLockFile,
3939
Stats

lib/git/cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

77
import os, sys
8-
from utils import *
9-
from errors import GitCommandError
8+
from util import *
9+
from exc import GitCommandError
1010

1111
from subprocess import (
1212
call,

lib/git/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import cStringIO
1414

1515
from git.odict import OrderedDict
16-
from git.utils import LockFile
16+
from git.util import LockFile
1717

1818
__all__ = ('GitConfigParser', )
1919

lib/git/diff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
import re
88
from objects.blob import Blob
9-
from objects.utils import mode_str_to_int
10-
from errors import GitCommandError
9+
from objects.util import mode_str_to_int
10+
from exc import GitCommandError
1111

1212
from gitdb.util import hex_to_bin
1313

File renamed without changes.

lib/git/index/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import git.objects
3737
import git.diff as diff
3838

39-
from git.errors import (
39+
from git.exc import (
4040
GitCommandError,
4141
CheckoutError
4242
)
@@ -48,9 +48,9 @@
4848
Commit,
4949
)
5050

51-
from git.objects.utils import Serializable
51+
from git.objects.util import Serializable
5252

53-
from git.utils import (
53+
from git.util import (
5454
IndexFileSHA1Writer,
5555
LazyMixin,
5656
LockedFD,

lib/git/index/fun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from stat import S_IFDIR
66
from cStringIO import StringIO
77

8-
from git.utils import IndexFileSHA1Writer
9-
from git.errors import UnmergedEntriesError
8+
from git.util import IndexFileSHA1Writer
9+
from git.exc import UnmergedEntriesError
1010
from git.objects.fun import (
1111
tree_to_stream,
1212
traverse_tree_recursive,

lib/git/objects/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from tree import *
99
from commit import *
1010
from submodule import *
11-
from utils import Actor
11+
from util import Actor
1212

1313
__all__ = [ name for name, obj in locals().items()
1414
if not (name.startswith('_') or inspect.ismodule(obj)) ]

lib/git/objects/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6-
from git.utils import LazyMixin, join_path_native, stream_copy
7-
from utils import get_object_type_by_name
6+
from git.util import LazyMixin, join_path_native, stream_copy
7+
from util import get_object_type_by_name
88
from gitdb.util import (
99
hex_to_bin,
1010
bin_to_hex,

lib/git/objects/commit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
from git.utils import (
7+
from git.util import (
88
Iterable,
99
Stats,
1010
)
@@ -17,7 +17,7 @@
1717
from gitdb.util import (
1818
hex_to_bin
1919
)
20-
from utils import (
20+
from util import (
2121
Traversable,
2222
Serializable,
2323
get_user_id,

lib/git/objects/tag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
""" Module containing all object based types. """
77
import base
88
from gitdb.util import hex_to_bin
9-
from utils import (
9+
from util import (
1010
get_object_type_by_name,
1111
parse_actor_and_date
1212
)

lib/git/objects/tree.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6-
import utils
6+
import util
77
from base import IndexObject
88

99
from blob import Blob
@@ -101,7 +101,7 @@ def __delitem__(self, name):
101101
#} END mutators
102102

103103

104-
class Tree(IndexObject, diff.Diffable, utils.Traversable, utils.Serializable):
104+
class Tree(IndexObject, diff.Diffable, util.Traversable, util.Serializable):
105105
"""Tree objects represent an ordered list of Blobs and other Trees.
106106
107107
``Tree as a list``::
@@ -214,7 +214,7 @@ def cache(self):
214214
def traverse( self, predicate = lambda i,d: True,
215215
prune = lambda i,d: False, depth = -1, branch_first=True,
216216
visit_once = False, ignore_self=1 ):
217-
"""For documentation, see utils.Traversable.traverse
217+
"""For documentation, see util.Traversable.traverse
218218
Trees are set to visit_once = False to gain more performance in the traversal"""
219219
return super(Tree, self).traverse(predicate, prune, depth, branch_first, visit_once, ignore_self)
220220

File renamed without changes.

lib/git/refs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
Object,
1111
Commit
1212
)
13-
from objects.utils import get_object_type_by_name
14-
from utils import (
13+
from objects.util import get_object_type_by_name
14+
from util import (
1515
LazyMixin,
1616
Iterable,
1717
join_path,

lib/git/remote.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
"""Module implementing a remote object allowing easy access to git remotes"""
77

8-
from errors import GitCommandError
8+
from exc import GitCommandError
99
from objects import Commit
1010

11-
from git.utils import (
11+
from git.util import (
1212
LazyMixin,
1313
Iterable,
1414
IterableList

lib/git/repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
from errors import InvalidGitRepositoryError, NoSuchPathError
7+
from exc import InvalidGitRepositoryError, NoSuchPathError
88
from cmd import Git
99
from objects import Actor
1010
from refs import *
File renamed without changes.

test/git/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from test.testlib import *
1212
from git import *
1313
from itertools import chain
14-
from git.objects.utils import get_object_type_by_name
14+
from git.objects.util import get_object_type_by_name
1515
from gitdb.util import hex_to_bin
1616
import tempfile
1717

test/git/test_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from test.testlib import *
88
from git import *
9-
from git.utils import IterableList
9+
from git.util import IterableList
1010
import tempfile
1111
import shutil
1212
import os

test/git/test_repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import os, sys
88
from test.testlib import *
99
from git import *
10-
from git.utils import join_path_native
10+
from git.util import join_path_native
1111
import tempfile
1212
import shutil
1313
from cStringIO import StringIO

test/git/test_utils.py renamed to test/git/test_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import tempfile
99

1010
from test.testlib import *
11-
from git.utils import *
12-
from git.objects.utils import *
11+
from git.util import *
12+
from git.objects.util import *
1313
from git import *
1414
from git.cmd import dashify
1515

0 commit comments

Comments
 (0)