diff options
author | Michał Górny <gentoo@mgorny.alt.pl> | 2010-07-11 12:18:38 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-07-11 11:25:56 -0700 |
commit | bc82a8eaaf99fb0ada2a9fd2cd3c082113d4690c (patch) | |
tree | bce05a3361b1cacab09238afd88143382b197c88 | |
parent | d277d60e8b0aa4c7146444cc47ca2e410417a5f0 (diff) | |
download | portage-bc82a8eaaf99fb0ada2a9fd2cd3c082113d4690c.tar.gz portage-bc82a8eaaf99fb0ada2a9fd2cd3c082113d4690c.tar.bz2 portage-bc82a8eaaf99fb0ada2a9fd2cd3c082113d4690c.zip |
Pass '--relative' to 'git diff-index'.
Instead of using faulty prefix-stripping code on 'git diff-index'
results, simply pass '--relative' to it. Thanks to that, git will do all
the stripping itself and return only changes in the current directory.
-rwxr-xr-x | bin/repoman | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/bin/repoman b/bin/repoman index 3243438e2..750bc6664 100755 --- a/bin/repoman +++ b/bin/repoman @@ -938,18 +938,10 @@ if vcs == "svn": mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ] mynew = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ] elif vcs == "git": - strip_levels = repolevel - 1 - - mychanged = os.popen("git diff-index --name-only --diff-filter=M HEAD").readlines() - if strip_levels: - mychanged = [elem[repo_subdir_len:] for elem in mychanged \ - if elem[:repo_subdir_len] == repo_subdir] + mychanged = os.popen("git diff-index --name-only --relative --diff-filter=M HEAD").readlines() mychanged = ["./" + elem[:-1] for elem in mychanged] - mynew = os.popen("git diff-index --name-only --diff-filter=A HEAD").readlines() - if strip_levels: - mynew = [elem[repo_subdir_len:] for elem in mynew \ - if elem[:repo_subdir_len] == repo_subdir] + mynew = os.popen("git diff-index --name-only --relative --diff-filter=A HEAD").readlines() mynew = ["./" + elem[:-1] for elem in mynew] elif vcs == "bzr": bzrstatus = os.popen("bzr status -S .").readlines() @@ -2161,24 +2153,13 @@ else: for prop in props if " - " in prop) elif vcs == "git": - strip_levels = repolevel - 1 - - mychanged = os.popen("git diff-index --name-only --diff-filter=M HEAD").readlines() - if strip_levels: - mychanged = [elem[repo_subdir_len:] for elem in mychanged \ - if elem[:repo_subdir_len] == repo_subdir] + mychanged = os.popen("git diff-index --name-only --relative --diff-filter=M HEAD").readlines() mychanged = ["./" + elem[:-1] for elem in mychanged] - mynew = os.popen("git diff-index --name-only --diff-filter=A HEAD").readlines() - if strip_levels: - mynew = [elem[repo_subdir_len:] for elem in mynew \ - if elem[:repo_subdir_len] == repo_subdir] + mynew = os.popen("git diff-index --name-only --relative --diff-filter=A HEAD").readlines() mynew = ["./" + elem[:-1] for elem in mynew] - myremoved = os.popen("git diff-index --name-only --diff-filter=D HEAD").readlines() - if strip_levels: - myremoved = [elem[repo_subdir_len:] for elem in myremoved \ - if elem[:repo_subdir_len] == repo_subdir] + myremoved = os.popen("git diff-index --name-only --relative --diff-filter=D HEAD").readlines() myremoved = ["./" + elem[:-1] for elem in myremoved] if vcs == "bzr": |