Show More
@@ -116,6 +116,10 b' else:' | |||||
116 | print "Unable to open repository" |
|
116 | print "Unable to open repository" | |
117 | sys.exit(0) |
|
117 | sys.exit(0) | |
118 |
|
118 | |||
|
119 | relpath = None | |||
|
120 | if os.getcwd() != repo.root: | |||
|
121 | relpath = os.getcwd()[len(repo.root) + 1: ] | |||
|
122 | ||||
119 | if cmd == "checkout" or cmd == "co": |
|
123 | if cmd == "checkout" or cmd == "co": | |
120 | node = repo.changelog.tip() |
|
124 | node = repo.changelog.tip() | |
121 | if args: |
|
125 | if args: | |
@@ -174,6 +178,9 b' elif cmd == "import" or cmd == "patch":' | |||||
174 |
|
178 | |||
175 | elif cmd == "status": |
|
179 | elif cmd == "status": | |
176 | (c, a, d) = repo.diffdir(repo.root, repo.current) |
|
180 | (c, a, d) = repo.diffdir(repo.root, repo.current) | |
|
181 | if relpath: | |||
|
182 | (c, a, d) = map(lambda x: filterfiles(x, [ relpath ]), (c, a, d)) | |||
|
183 | ||||
177 | for f in c: print "C", f |
|
184 | for f in c: print "C", f | |
178 | for f in a: print "?", f |
|
185 | for f in a: print "?", f | |
179 | for f in d: print "R", f |
|
186 | for f in d: print "R", f | |
@@ -192,8 +199,7 b' elif cmd == "diff":' | |||||
192 | print "too many revisions to diff" |
|
199 | print "too many revisions to diff" | |
193 | sys.exit(1) |
|
200 | sys.exit(1) | |
194 |
|
201 | |||
195 | if os.getcwd() != repo.root: |
|
202 | if relpath: | |
196 | relpath = os.getcwd()[len(repo.root) + 1: ] |
|
|||
197 | if not args: args = [ relpath ] |
|
203 | if not args: args = [ relpath ] | |
198 | else: args = [ os.path.join(relpath, x) for x in args ] |
|
204 | else: args = [ os.path.join(relpath, x) for x in args ] | |
199 |
|
205 | |||
@@ -248,7 +254,11 b' elif cmd == "history":' | |||||
248 | print changes[4] |
|
254 | print changes[4] | |
249 |
|
255 | |||
250 | elif cmd == "log": |
|
256 | elif cmd == "log": | |
251 | if args: |
|
257 | ||
|
258 | if len(args) == 1: | |||
|
259 | if relpath: | |||
|
260 | args[0] = os.path.join(relpath, args[0]) | |||
|
261 | ||||
252 | r = repo.file(args[0]) |
|
262 | r = repo.file(args[0]) | |
253 | for i in range(r.count()): |
|
263 | for i in range(r.count()): | |
254 | n = r.node(i) |
|
264 | n = r.node(i) | |
@@ -261,6 +271,14 b' elif cmd == "log":' | |||||
261 | print "changeset: %4d:%s" % (cr, cn) |
|
271 | print "changeset: %4d:%s" % (cr, cn) | |
262 | print "parents: %4d:%s" % (i1, h1) |
|
272 | print "parents: %4d:%s" % (i1, h1) | |
263 | if i2: print " %4d:%s" % (i2, h2) |
|
273 | if i2: print " %4d:%s" % (i2, h2) | |
|
274 | changes = repo.changelog.read(repo.changelog.node(cr)) | |||
|
275 | print "user: %s date: %s" % (changes[1], time.asctime( | |||
|
276 | time.localtime(float(changes[2].split(' ')[0])))) | |||
|
277 | print "description:" | |||
|
278 | print changes[4] | |||
|
279 | ||||
|
280 | elif len(args) > 1: | |||
|
281 | print "too many args" | |||
264 | else: |
|
282 | else: | |
265 | print "missing filename" |
|
283 | print "missing filename" | |
266 |
|
284 |
General Comments 0
You need to be logged in to leave comments.
Login now