393 Commits

Author SHA1 Message Date
Nico von Geyso
b4656cc99c Merge remote-tracking branch 'upstream/master' into features/diff_refactoring
Conflicts:
	src/tree.c
2013-05-18 15:48:27 +02:00
Nico von Geyso
0fc7a4fbad Refactored Index.diff() into Index.diff_to_tree()/diff_to_workdir() 2013-05-18 15:29:28 +02:00
Nico von Geyso
196d0595b0 Added: Repository.diff() - porcelain method similiar to 2013-05-18 14:48:05 +02:00
Bernardo Heynemann
a831b8b6f6 Since I was PEP8-ing my tests, I decided to do it for the whole file. 2013-05-16 10:04:17 -03:00
Bernardo Heynemann
3dd998c061 Supporting clone in pygit2 2013-05-15 18:15:00 -03:00
Nico von Geyso
8c76a14a99 added reorder trees possibility for diff_to_tree() 2013-05-09 14:40:45 +02:00
Nico von Geyso
ae6cd8a0ca refactoring Tree.diff() into seperate methods
* Tree.diff_to_tree()
* Tree.diff_to_workdir()
* Tree.diff-to_index()
2013-05-07 14:06:20 +02:00
Nico von Geyso
2d812b671a fixed line_origin in Hunks
every line in a hunk has a origin like '+','-' or ' '.
2013-05-07 13:23:17 +02:00
J. David Ibáñez
d5e28c0f96 Merge remote-tracking branch 'cholin/features/diff_line_origin' 2013-05-06 19:36:57 +02:00
Nico von Geyso
b7b9728115 support for diffing the empty tree
added missing support for diffing tree-to-tree with NULL as argument.
(see issue #222)
2013-05-06 14:41:08 +02:00
Nico von Geyso
f572a8fb00 use chars like +,-,... for diff_delta_t in Patch.status 2013-05-06 13:29:37 +02:00
Nico von Geyso
f972d99d5f Added line origins for Hunks in Pygit2.Patch 2013-05-06 13:22:48 +02:00
J. David Ibáñez
974f16ca69 Re-work the checkout API
New API:

  Repository.head = refname
  Repository.checkout_head(strategy)
  Repository.checkout_index(strategy)
  Repository.checkout_tree(treeish, strategy)

Changed API:

  # Before
  Repository.checkout(strategy=GIT_CHECKOUT_SAFE_CREATE, reference=None,
                      head=False)

  # Now
  Repository.checkout(refname=None, strategy=GIT_CHECKOUT_SAFE_CREATE)
2013-05-05 21:45:39 +02:00
J. David Ibáñez
9c0a82876b Merge remote-tracking branch 'xtao/merge-base' 2013-05-05 00:40:21 +02:00
J. David Ibáñez
723cae1186 Fix tests for Python 2.6 2013-05-04 00:40:32 +02:00
J. David Ibáñez
42aed417d4 Add TreeBuilder.get and remove TreeEntry.to_object
Also, check errors from git_tree_entry_dup
2013-05-04 00:31:03 +02:00
XTao
3474dca78f Add merge-base method. 2013-05-04 05:45:03 +08:00
J. David Ibáñez
f5082b320b Add "len(treebuider)" to the API 2013-05-03 23:31:43 +02:00
J. David Ibáñez
b12a596068 Remove "del index[xxx]" from the API
Use "index.remove(xxx)" instead.
2013-05-02 20:28:14 +02:00
J. David Ibáñez
e186c06470 Merge remote-tracking branch 'bors/v0.18.1'
API change:

- Rename Repository.create_blob_fromfile to Repository.create_blob_fromworkdir
2013-05-01 20:37:00 +02:00
Hervé Cauwelier
61c330f57d split create_blob_fromfile into fromworkdir and fromdisk to match libgit2
Both create loose blobs but fromworkdir assert the file is inside the working directory.
2013-05-01 13:05:30 +02:00
J. David Ibáñez
67417c7f56 create_reference, drop the symbolic param (#213)
Now we figure out whether it is a direct or symbolic reference based on
the type and value of the target. This guessing will fail in very very
rare situations, for that we still have the explicit lower level API.
2013-04-27 11:39:37 +02:00
J. David Ibáñez
979cda9a9a refs: improve API (#213)
Changes:

- Reference.oid and Reference.hex removed
- Now Reference.target can be assigned an oid
2013-04-21 10:46:04 +02:00
J. David Ibáñez
fd67685500 The repository iterator now returns Oids, not hexs 2013-04-20 09:38:12 +02:00
J. David Ibáñez
a3a928a513 Now Reference.target returns an Oid, not hex
If the reference is direct, of course.
2013-04-20 09:03:13 +02:00
J. David Ibáñez
7261f4e1e7 Now Note.oid returns an Oid object, not an hex 2013-04-20 08:48:03 +02:00
J. David Ibáñez
94f44feb22 Fix unit tests with Python 2.6 2013-04-18 23:59:34 +02:00
J. David Ibáñez
4cf1fc2371 Make Oid hashable 2013-04-18 23:57:19 +02:00
J. David Ibáñez
f74a211f14 oid: now only accept Oid or hex, not raw
Every method that takes an oid has changed what it accepts.

Before it was (in both Python 2 and 3):

- An Oid object
- An hex oid, represented as a unicode string
- A raw oid, represented as a bytes string

Now the behaviour is different between Python 2 and 3.

Now in Python 2 we take:

- An Oid object
- An hex oid, represented as a bytes or unicode string

Now in Python 3 we take:

- An Oid object
- An hex oid, represented as a unicode string

We have dropt direct support for raw strings. To use a raw string first
build an Oid object: oid = Oid(raw=raw)

We have also dropt support for short raw oids. The Oid constructor takes
full oids, if passed short oids the behavior is undefined.
2013-04-18 20:32:30 +02:00
J. David Ibáñez
571fe8ac44 Merge branch 'master' into oid
Conflicts:
	test/test_repository.py
2013-04-18 18:30:50 +02:00
J. David Ibáñez
611e979113 Now Repository.head returns a reference (#203)
Now Repository.head behaves like libgit2's git_repository_head, it
returns the resolved reference. These two lines are equivalent:

  ref = repo.head
  ref = repo.lookup_reference('HEAD').resolve()

Before it returned a commit.
2013-04-17 08:16:43 +02:00
J. David Ibáñez
a9c9f25ce2 oid: support rich comparisons (less than, etc.) 2013-04-14 14:08:46 +02:00
J. David Ibáñez
bd54d28157 Fix for Python3, and add Oid cmp tests 2013-04-14 13:50:09 +02:00
J. David Ibáñez
406c317572 Return Oid wherever we returned raw oid (bytes) before
Changes:

- Return Oid wherever we returned raw oid (bytes) before
- Now py_str_to_git_oid accepts Oid objects
- Add ability to compare two Oid objects
2013-04-14 12:26:22 +02:00
J. David Ibáñez
f8544cc514 Add Oid type 2013-04-13 13:04:52 +02:00
J. David Ibáñez
c3ca27fa72 Merge branch 'master' into next
Conflicts:
	include/pygit2/types.h
	src/oid.c
2013-03-23 15:54:12 +01:00
Nico von Geyso
119d0e0344 added missing unittest.main() for tests_remote.py 2013-03-13 12:48:58 +01:00
Nico von Geyso
4c782f451d fixed non working test for config.set_multivar() 2013-03-13 12:48:34 +01:00
Nico von Geyso
e99573dfb8 reactivated TreeBuilder test 2013-03-12 23:52:42 +01:00
Nico von Geyso
fa8ef0d6d4 Repository_read().data should be binary data 2013-03-12 23:50:44 +01:00
J. David Ibáñez
7bfc37bf34 Merge branch 'master' into next
Conflicts:
	src/repository.c
2013-03-12 08:24:56 +01:00
Nico von Geyso
511b760a56 added tests for notes 2013-03-11 20:48:58 +01:00
Nico von Geyso
a89d55a0f3 added notes in testreop 2013-03-11 20:48:57 +01:00
Nico von Geyso
d8bb184a31 diff refactorization 2013-03-11 18:10:29 +01:00
J. David Ibáñez
98013eb44d Support short (raw) oids 2013-03-10 12:26:32 +01:00
J. David Ibáñez
27aba1f3c8 Update to changes in libgit2 concerning refs
Two methods have been drop:

- Repository.packall_references
- Reference.reload

The unit tests have been commented until we wrap the new reference
database from libgit2.
2013-03-09 12:36:58 +01:00
Nico von Geyso
86b063fbd0 fixed assert for diff.find_similiar test 2013-03-04 19:32:12 +01:00
Nico von Geyso
da4abb78cb added test data for diff.find_similiar 2013-03-04 18:37:45 +01:00
Nico von Geyso
204fbd9cbb diff - use generator instead of list 2013-03-04 16:37:59 +01:00
Nico von Geyso
2771c8a150 added assertAll and assertAny for test cases 2013-03-04 15:44:17 +01:00