| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,6 +61,7 @@ GitCommand | |||
| 61 | 61 | Commit | |
| 62 | 62 | ------ | |
| 63 | 63 | * 'count' method is not an instance method to increase its ease of use | |
| 64 | + * 'name_rev' property returns a nice name for the commit's sha | ||
| 64 | 65 | ||
| 65 | 66 | Config | |
| 66 | 67 | ------ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -117,6 +117,15 @@ def count(self, paths='', **kwargs): | |||
| 117 | 117 | """ | |
| 118 | 118 | return len(self.repo.git.rev_list(self.id, '--', paths, **kwargs).strip().splitlines()) | |
| 119 | 119 | ||
| 120 | + @property | ||
| 121 | + def name_rev(self): | ||
| 122 | + """ | ||
| 123 | + Returns | ||
| 124 | + String describing the commits hex sha based on the closest Reference. | ||
| 125 | + Mostly useful for UI purposes | ||
| 126 | + """ | ||
| 127 | + return self.repo.git.name_rev(self) | ||
| 128 | + | ||
| 120 | 129 | @classmethod | |
| 121 | 130 | def iter_items(cls, repo, rev, paths='', **kwargs): | |
| 122 | 131 | """ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -94,3 +94,7 @@ def test_iter_parents(self): | |||
| 94 | 94 | assert first_parent == c.parents[0] | |
| 95 | 95 | # END for each | |
| 96 | 96 | ||
| 97 | + def test_base(self): | ||
| 98 | + name_rev = self.rorepo.head.commit.name_rev | ||
| 99 | + assert isinstance(name_rev, basestring) | ||
| 100 | + | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments