소스 검색

Support paths argument to 'dulwich log'.

Jelmer Vernooij 8 년 전
부모
커밋
c7205cced2
2개의 변경된 파일3개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 5
      bin/dulwich
  2. 2 2
      dulwich/porcelain.py

+ 1 - 5
bin/dulwich

@@ -96,11 +96,7 @@ def cmd_fetch(args):
 
 def cmd_log(args):
     opts, args = getopt(args, "", [])
-    if len(args) > 0:
-        path = args.pop(0)
-    else:
-        path = "."
-    porcelain.log(repo=path, outstream=sys.stdout)
+    porcelain.log(".", paths=args, outstream=sys.stdout)
 
 
 def cmd_diff(args):

+ 2 - 2
dulwich/porcelain.py

@@ -416,7 +416,7 @@ def show_object(repo, obj, decode, outstream):
             }[obj.type_name](repo, obj, decode, outstream)
 
 
-def log(repo=".", outstream=sys.stdout, max_entries=None):
+def log(repo=".", paths=None, outstream=sys.stdout, max_entries=None):
     """Write commit logs.
 
     :param repo: Path to repository
@@ -424,7 +424,7 @@ def log(repo=".", outstream=sys.stdout, max_entries=None):
     :param max_entries: Optional maximum number of entries to display
     """
     with open_repo_closing(repo) as r:
-        walker = r.get_walker(max_entries=max_entries)
+        walker = r.get_walker(max_entries=max_entries, paths=paths)
         for entry in walker:
             decode = lambda x: commit_decode(entry.commit, x)
             print_commit(entry.commit, decode, outstream)