Show More
@@ -56,9 +56,14 b' class convert_git(converter_source):' | |||||
56 | self.modecache = {} |
|
56 | self.modecache = {} | |
57 | fh = self.gitcmd("git-diff-tree --root -m -r %s" % version) |
|
57 | fh = self.gitcmd("git-diff-tree --root -m -r %s" % version) | |
58 | changes = [] |
|
58 | changes = [] | |
|
59 | seen = {} | |||
59 | for l in fh: |
|
60 | for l in fh: | |
60 |
if "\t" not in l: |
|
61 | if "\t" not in l: | |
|
62 | continue | |||
61 | m, f = l[:-1].split("\t") |
|
63 | m, f = l[:-1].split("\t") | |
|
64 | if f in seen: | |||
|
65 | continue | |||
|
66 | seen[f] = 1 | |||
62 | m = m.split() |
|
67 | m = m.split() | |
63 | h = m[3] |
|
68 | h = m[3] | |
64 | p = (m[1] == "100755") |
|
69 | p = (m[1] == "100755") |
@@ -1638,6 +1638,9 b' def refresh(ui, repo, *pats, **opts):' | |||||
1638 | q = repo.mq |
|
1638 | q = repo.mq | |
1639 | message = cmdutil.logmessage(opts) |
|
1639 | message = cmdutil.logmessage(opts) | |
1640 | if opts['edit']: |
|
1640 | if opts['edit']: | |
|
1641 | if not q.applied: | |||
|
1642 | ui.write(_("No patches applied\n")) | |||
|
1643 | return 1 | |||
1641 | if message: |
|
1644 | if message: | |
1642 | raise util.Abort(_('option "-e" incompatible with "-m" or "-l"')) |
|
1645 | raise util.Abort(_('option "-e" incompatible with "-m" or "-l"')) | |
1643 | patch = q.applied[-1].name |
|
1646 | patch = q.applied[-1].name |
@@ -598,9 +598,12 b' def docopy(ui, repo, pats, opts):' | |||||
598 | raise util.Abort(_('no destination specified')) |
|
598 | raise util.Abort(_('no destination specified')) | |
599 | dest = pats.pop() |
|
599 | dest = pats.pop() | |
600 | destdirexists = os.path.isdir(dest) |
|
600 | destdirexists = os.path.isdir(dest) | |
601 | if (len(pats) > 1 or util.patkind(pats[0], None)[0]) and not destdirexists: |
|
601 | if not destdirexists: | |
|
602 | if len(pats) > 1 or util.patkind(pats[0], None)[0]: | |||
602 | raise util.Abort(_('with multiple sources, destination must be an ' |
|
603 | raise util.Abort(_('with multiple sources, destination must be an ' | |
603 | 'existing directory')) |
|
604 | 'existing directory')) | |
|
605 | if dest.endswith(os.sep) or os.altsep and dest.endswith(os.altsep): | |||
|
606 | raise util.Abort(_('destination %s is not a directory') % dest) | |||
604 | if opts['after']: |
|
607 | if opts['after']: | |
605 | tfn = targetpathafterfn |
|
608 | tfn = targetpathafterfn | |
606 | else: |
|
609 | else: | |
@@ -1470,6 +1473,10 b' def identify(ui, repo, source=None,' | |||||
1470 | name for non-default branches. |
|
1473 | name for non-default branches. | |
1471 | """ |
|
1474 | """ | |
1472 |
|
1475 | |||
|
1476 | if not repo and not source: | |||
|
1477 | raise util.Abort(_("There is no Mercurial repository here " | |||
|
1478 | "(.hg not found)")) | |||
|
1479 | ||||
1473 | hexfunc = ui.debugflag and hex or short |
|
1480 | hexfunc = ui.debugflag and hex or short | |
1474 | default = not (num or id or branch or tags) |
|
1481 | default = not (num or id or branch or tags) | |
1475 | output = [] |
|
1482 | output = [] | |
@@ -3153,4 +3160,4 b' table = {' | |||||
3153 |
|
3160 | |||
3154 | norepo = ("clone init version help debugancestor debugcomplete debugdata" |
|
3161 | norepo = ("clone init version help debugancestor debugcomplete debugdata" | |
3155 | " debugindex debugindexdot debugdate debuginstall") |
|
3162 | " debugindex debugindexdot debugdate debuginstall") | |
3156 | optionalrepo = ("paths serve showconfig") |
|
3163 | optionalrepo = ("identify paths serve showconfig") |
@@ -141,7 +141,10 b' class hgweb(object):' | |||||
141 | def nodebranchdict(self, ctx): |
|
141 | def nodebranchdict(self, ctx): | |
142 | branches = [] |
|
142 | branches = [] | |
143 | branch = ctx.branch() |
|
143 | branch = ctx.branch() | |
144 | if self.repo.branchtags()[branch] == ctx.node(): |
|
144 | # If this is an empty repo, ctx.node() == nullid, | |
|
145 | # ctx.branch() == 'default', but branchtags() is | |||
|
146 | # an empty dict. Using dict.get avoids a traceback. | |||
|
147 | if self.repo.branchtags().get(branch) == ctx.node(): | |||
145 | branches.append({"name": branch}) |
|
148 | branches.append({"name": branch}) | |
146 | return branches |
|
149 | return branches | |
147 |
|
150 |
@@ -146,8 +146,9 b' class hgwebdir(object):' | |||||
146 | u = ui.ui(parentui=parentui) |
|
146 | u = ui.ui(parentui=parentui) | |
147 | try: |
|
147 | try: | |
148 | u.readconfig(os.path.join(path, '.hg', 'hgrc')) |
|
148 | u.readconfig(os.path.join(path, '.hg', 'hgrc')) | |
149 |
except |
|
149 | except Exception, e: | |
150 | pass |
|
150 | u.warn(_('error reading %s/.hg/hgrc: %s\n' % (path, e))) | |
|
151 | continue | |||
151 | def get(section, name, default=None): |
|
152 | def get(section, name, default=None): | |
152 | return u.config(section, name, default, untrusted=True) |
|
153 | return u.config(section, name, default, untrusted=True) | |
153 |
|
154 |
@@ -298,8 +298,7 b' class httprepository(remoterepository):' | |||||
298 | cu = "%s%s" % (self._url, qs) |
|
298 | cu = "%s%s" % (self._url, qs) | |
299 | try: |
|
299 | try: | |
300 | if data: |
|
300 | if data: | |
301 | self.ui.debug(_("sending %s bytes\n") % |
|
301 | self.ui.debug(_("sending %s bytes\n") % len(data)) | |
302 | headers.get('content-length', 'X')) |
|
|||
303 | resp = urllib2.urlopen(request(cu, data, headers)) |
|
302 | resp = urllib2.urlopen(request(cu, data, headers)) | |
304 | except urllib2.HTTPError, inst: |
|
303 | except urllib2.HTTPError, inst: | |
305 | if inst.code == 401: |
|
304 | if inst.code == 401: |
@@ -5,15 +5,42 b'' | |||||
5 | echo "[extensions]" >> $HGRCPATH |
|
5 | echo "[extensions]" >> $HGRCPATH | |
6 | echo "convert=" >> $HGRCPATH |
|
6 | echo "convert=" >> $HGRCPATH | |
7 |
|
7 | |||
|
8 | GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME | |||
|
9 | GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL | |||
|
10 | GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE | |||
|
11 | GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME | |||
|
12 | GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL | |||
|
13 | GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE | |||
|
14 | ||||
|
15 | count=10 | |||
|
16 | commit() | |||
|
17 | { | |||
|
18 | GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" | |||
|
19 | GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" | |||
|
20 | git commit "$@" >/dev/null 2>/dev/null || echo "git commit error" | |||
|
21 | count=`expr $count + 1` | |||
|
22 | } | |||
|
23 | ||||
8 | mkdir git-repo |
|
24 | mkdir git-repo | |
9 | cd git-repo |
|
25 | cd git-repo | |
10 | git init-db >/dev/null 2>/dev/null |
|
26 | git init-db >/dev/null 2>/dev/null | |
11 | echo a > a |
|
27 | echo a > a | |
12 | git add a |
|
28 | git add a | |
13 | git commit -m t1 >/dev/null 2>/dev/null || echo "git commit error" |
|
29 | commit -m t1 | |
|
30 | ||||
14 | echo b >> a |
|
31 | echo b >> a | |
15 | git commit -a -m t2 >/dev/null || echo "git commit error" |
|
32 | commit -a -m t2.1 | |
|
33 | ||||
|
34 | git checkout -b other HEAD^ >/dev/null 2>/dev/null | |||
|
35 | echo c > a | |||
|
36 | echo a >> a | |||
|
37 | commit -a -m t2.2 | |||
|
38 | ||||
|
39 | git checkout master >/dev/null 2>/dev/null | |||
|
40 | git pull --no-commit . other > /dev/null 2>/dev/null | |||
|
41 | commit -m 'Merge branch other' | |||
16 | cd .. |
|
42 | cd .. | |
17 |
|
43 | |||
18 | hg convert git-repo |
|
44 | hg convert --datesort git-repo | |
19 |
|
45 | |||
|
46 | hg -R git-repo-hg tip -v |
@@ -3,5 +3,20 b' initializing destination git-repo-hg rep' | |||||
3 | scanning source... |
|
3 | scanning source... | |
4 | sorting... |
|
4 | sorting... | |
5 | converting... |
|
5 | converting... | |
6 |
|
|
6 | 3 t1 | |
7 |
|
|
7 | 2 t2.1 | |
|
8 | 1 t2.2 | |||
|
9 | 0 Merge branch other | |||
|
10 | changeset: 3:69b3a302b4a1 | |||
|
11 | tag: tip | |||
|
12 | parent: 1:0de2a40e261b | |||
|
13 | parent: 2:8815d3b33506 | |||
|
14 | user: test <test@example.org> | |||
|
15 | date: Mon Jan 01 00:00:13 2007 +0000 | |||
|
16 | files: a | |||
|
17 | description: | |||
|
18 | Merge branch other | |||
|
19 | ||||
|
20 | committer: test <test@example.org> | |||
|
21 | ||||
|
22 |
@@ -8,6 +8,11 b' echo "mq=" >> $HGRCPATH' | |||||
8 | hg init |
|
8 | hg init | |
9 | hg qinit |
|
9 | hg qinit | |
10 |
|
10 | |||
|
11 | echo ======================= | |||
|
12 | echo "Should fail if no patches applied" | |||
|
13 | hg qrefresh | |||
|
14 | hg qrefresh -e | |||
|
15 | ||||
11 | hg qnew -m "First commit message" first-patch |
|
16 | hg qnew -m "First commit message" first-patch | |
12 | echo aaaa > file |
|
17 | echo aaaa > file | |
13 | hg add file |
|
18 | hg add file |
@@ -1,3 +1,7 b'' | |||||
|
1 | ======================= | |||
|
2 | Should fail if no patches applied | |||
|
3 | No patches applied | |||
|
4 | No patches applied | |||
1 | ======================= |
|
5 | ======================= | |
2 | Should display 'First commit message' |
|
6 | Should display 'First commit message' | |
3 | description: |
|
7 | description: |
@@ -88,6 +88,11 b' hg status -C' | |||||
88 | diff d1/b d2/b |
|
88 | diff d1/b d2/b | |
89 | hg update -C |
|
89 | hg update -C | |
90 |
|
90 | |||
|
91 | echo "# attempt to move one file into a non-existent directory" | |||
|
92 | hg rename d1/a dx/ | |||
|
93 | hg status -C | |||
|
94 | hg update -C | |||
|
95 | ||||
91 | echo "# attempt to move potentially more than one file into a non-existent" |
|
96 | echo "# attempt to move potentially more than one file into a non-existent" | |
92 | echo "# directory" |
|
97 | echo "# directory" | |
93 | hg rename 'glob:d1/**' dx |
|
98 | hg rename 'glob:d1/**' dx |
@@ -166,6 +166,9 b' 1c1' | |||||
166 | --- |
|
166 | --- | |
167 | > d2/b |
|
167 | > d2/b | |
168 | 3 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
168 | 3 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
|
169 | # attempt to move one file into a non-existent directory | |||
|
170 | abort: destination dx/ is not a directory | |||
|
171 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
169 | # attempt to move potentially more than one file into a non-existent |
|
172 | # attempt to move potentially more than one file into a non-existent | |
170 | # directory |
|
173 | # directory | |
171 | abort: with multiple sources, destination must be an existing directory |
|
174 | abort: with multiple sources, destination must be an existing directory |
General Comments 0
You need to be logged in to leave comments.
Login now