summaryrefslogtreecommitdiff
path: root/tests/test_GitRepository.py
AgeCommit message (Collapse)Author
2014-12-05GitRepository: Implement status methodEd Bartosh
Simple wrapper to the git-status command. Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-12-05GitRepository: add diff_status methodMarkus Lehtonen
This is a method of getting the filename and status information of a diff. That is, a list of files that changed and their status, "added", "modified" etc. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10git: new class and method for remote repositoriesMarkus Lehtonen
Add a new GitRemote class for representing git remote repositories. The initial, very limited, version only contains information about the fetch and push URLs of the remote repository. Also, add a new GitRepository.get_remotes() method for getting remote repositories as instances of the new GitRemote class. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10GitRepository.pull: Add 'all_remotes' optionLingchaox Xin
Also changes the method to utilize the GitArgs class. Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10GitRepository.push: Add 'tags' optionLingchaox Xin
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10GitRepository.push: Add 'force' optionLingchaox Xin
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-10GitRepository.list_tree: add 'paths' optionMarkus Lehtonen
Change-Id: I9331fec6fcd0e58dad7cb4a571a683e09ce08011 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-05GitRepository.diff: add 'text' optionMarkus Lehtonen
For generating textual diffs. Useful for Pq - for example, the 'patch' utility does not support git binary diffs. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04GitRepository: Add clean() methodMarkus Lehtonen
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04GitRepository.fetch: Add 'all_remotes' optionLingchaox Xin
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04GitRepository.fetch: Add 'refspec' optionLingchaox Xin
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-09-04GitRepository.describe: add 'tags' and 'extra-match' optionsLingchaox Xin
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-07-04GitRepository.set_upstream_branch: Newer git wants a valid remote repo entryGuido Günther
so set one in the tests before trying to set the upstream branch. Found with git 1.8.3.2
2013-06-11GitRepository.get_subject: use get_commit_infoGuido Günther
This kills another _git_getoutput. Also deprecate the method since we don't need to special case the subject.
2013-06-06GitRepository/get_commit_info: add patchname to infoMarkus Lehtonen
Add a new 'patchname' field to the information returned by get_commit_info. That is, the subject in a sanitized format, similar to what git-format-patch uses. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-27GitRepository.has_feature: capture stderrGuido Günther
to avoid spurious output on the console and add the error message to the exception intead.
2013-04-27Silence GitRepository.grep_logGuido Günther
None of the gbp script rely on the output being printed. In fact we improve the exception by appending the stderr output.
2013-04-25GitRepository: add describe() methodMarkus Lehtonen
Provides more output options than find_tag(). - longfmt: for getting the tag name in the long format (tag, number of commits and sha1) - always: for falling back to sha1 if no (matching) tag name is found - abbrev: for defining the length of sha1 returned Change GitRepository.find_tag() to use the the new method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-04-13Introduce Source classGuido Günther
so we don't have to expose all the details of Debian's different files and conventions.
2013-04-08tests: Use tempfile.mkdtemp to create temp dirs for testsThomas Koch
This puts test dirs below /tmp which often is a tmpfs. All tests include the context module which consolidates tmpdir creation and cleanup, undoes a chdir in teardown and silences log messages.
2013-03-27tests.test_GitRepository: import and setup gbp.logMarkus Lehtonen
In order to initialize gbp logging properly. Fixes false positives when the GitRepository tests are run alone. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-03-22GitRepository/_cmd_has_feature: more intelligent parsingMarkus Lehtonen
More intelligent parsing of the git output (man page). Try to parse optional options like '--[no-]standard-notes' of git-show correctly. In this example both 'no-standard-notes' and 'standard-notes' would be available. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-23GitRepository/get_commits: more flexible revision rangesMarkus Lehtonen
Support getting the complete history of an arbitrary commit-ish (since=None, until=COMMIT-ISH). Formerly this was only possible for the current git HEAD. Now, get_commits(since=None, until='COMMIT') translates to 'git log COMMIT'. Also, for consistency, add support for getting the history from an arbitrary commit until the current HEAD (since=COMMIT-ISH, until=None). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository/diff: add 'paths' argumentMarkus Lehtonen
Makes the diff function more versatile. I.e. makes diffing only certain paths possible. Also, add basic unittests for the diff() method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository.find_tag: change deprecated _git_getoutput to _git_inoutEd Bartosh
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-11-07GitRepository: implement _cmd_has_feature() methodMarkus Lehtonen
This method is intended for checking if the local git (client) command supports a certain feature. The "feature" is considered to be a command line option. E.g. does "merge" command have the "edit" feature translates to does git-merge support the '--edit' command line option. To figure this out, _cmd_has_feature() parses through the "OPTIONS" section of the man page of the git command. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-08-22GitRepository: Implement set_upstream_branch and get_upstream_branch methodsEd Bartosh
set_upstream_branch sets upstream branch for the local branch using git branch --set-upstream get_upstream_branch returns info about upstream branches Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2012-07-27GitRepository/get_commit_info: add file statusMarkus Lehtonen
Add file status and name to the info returned by the get_commit_info() method. Signed-off-by: Zhang Qiang <qiang.z.zhang@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-27GitRepository/get_commit_info: add committer infoMarkus Lehtonen
Add committer to the info returned by get_commit_info() method. Returns committer name, email and timestamp as a GitModifier object. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-27GitRepository/get_commit_info: add author timestampMarkus Lehtonen
Add author timestamps to the info returned by get_commit_info() method. Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-24GitRepository: option to ignore untracked in is_clean()Markus Lehtonen
Add an option to ignore untracked files when checking if the repository is clean. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-07-23gbp.git.GitRepository: Add remove_remoteGuido Günther
2012-07-03GitRepository: Make rev_parse's short option an int everywhereGuido Günther
2012-06-30GitRepository: Add test that covers remote branches in has_branch()Guido Günther
2012-06-30GitRepository: return GitModifier object instead of separate fieldsGuido Günther
this make sure the number of return values doesn't stays sane when also returning timestamps and committer information.
2012-06-30GitRepository: make get_commit_info() more robustMarkus Lehtonen
Now uses git-show instead of git-log. This is needed for further enhancements (namely to get name-status for merge commits). Also, use null-character as the field separator which makes parsing more reliable. The method now returns 'body' of the commit message as is, without stripping or splitting to lines. In addition, get_commit_info() now uses GitArgs and _git_inout() instead of the deprecated _git_getoutput(). Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-06-30tests: test GitRepository.get_commit_info()Guido Günther
2012-05-31gbp.git.repository: add GitRepository.make_treeGuido Günther
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2012-05-31gbp.git.repository: Add GitRepository.write_fileGuido Günther
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2012-05-31gbp.git.repository: Add GitRepository.list_treeGuido Günther
2012-05-15Fix typo in doctest that made epydoc fail.Guido Günther
Git-Dch: Ignore
2012-05-14gbp.git.repository: Add a "git merge-base" wrapperDaniel Dehennin
Closes: #672642 Signed-off-by: Guido Günther <agx@sigxcpu.org>
2012-01-21GitRepository: add get_obj_type()Markus Lehtonen
get_obj_type() returns the type of a git repository object.
2012-01-15GitRepository: add rename_branch() methodMarkus Lehtonen
2012-01-12GitRepository: Allow to explicitly fetch tagsGuido Günther
2012-01-10GitRepository.branch_contains: fix misplaced remote parameterGuido Günther
2012-01-10GitRepository: Test find_tag() and add_remote_repo()Guido Günther
2012-01-10GitRepository: Add branch_contains()Guido Günther
to check if a branch contains a specific commit
2012-01-10GitRepository: add verify_tag()Guido Günther
2012-01-10GitRepository: add push() and push_tag()Guido Günther